Skip to content

Commit b60fbe8

Browse files
authored
Remove canonical vertices, the incidence weld filter and the tree space plane cache (#60)
* Use only ASCII in comments * Refer to generated object names by their searchable part in comments * Remove canonical vertices, the incidence weld filter and the tree space plane cache Canonical vertices were an experiment for the old CSG path and never shipped (stage 0, off). Removed with them: the incidence weld filter (also an old path experiment, off), the HashedVertices overloads that took it, and the tree space plane cache, which only those read. The base polygons are built as before: corners as they are, snapped onto the corners of the brushes touching them (the hotspot caps read those corners). Fixes #59
1 parent dd854ec commit b60fbe8

30 files changed

Lines changed: 19 additions & 2155 deletions

‎Components/Tests/ChiselMaterialMeshTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void AChunk_IsNotSplit_InAModelLitByProbes()
186186
Assert.That(RenderersOf(model, first).Count, Is.EqualTo(1), "one mesh for the 32 m cell");
187187
}
188188

189-
// Three boxes of about 6 m² of lightmap each: with room for 15, their 32 m cell (18) splits into its 16 m cells (12 and 6)
189+
// Three boxes of about 6 m^2 of lightmap each: with room for 15, their 32 m cell (18) splits into its 16 m cells (12 and 6)
190190
[Test]
191191
public void ASplitStopsAtTheCellsThatFit()
192192
{

‎Core/1.Input/BrushMesh/BrushMesh.Utility.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static bool SplitPolygon(int polygonIndex, List<VertexSide> vertexDistances, Lis
655655
intersections[i0] = planeTraversal0;
656656
}
657657

658-
// NOTE: from this point on Traversal𝑛.EdgeIndex may no longer be valid!
658+
// NOTE: from this point on TraversalN.EdgeIndex may no longer be valid!
659659

660660

661661
Debug.Assert((intersections.Count & 1) != 1, "Found an uneven number of edge-plane traversals??");

‎Core/1.Input/Nodes/CSGTree.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public bool InsertRange(int index, NativeArray<CSGTreeNode> array)
199199

200200
/// <summary>Determines the index of a specific child in the <see cref="Chisel.Core.CSGTree"/>.</summary>
201201
/// <param name="item">The <see cref="Chisel.Core.CSGTreeNode"/> to locate in the <see cref="Chisel.Core.CSGTree"/>.</param>
202-
/// <returns>The index of <paramref name="item"/> if found in the <see cref="Chisel.Core.CSGTree"/>; otherwise, –1.</returns>
202+
/// <returns>The index of <paramref name="item"/> if found in the <see cref="Chisel.Core.CSGTree"/>; otherwise, -1.</returns>
203203
public int IndexOf (CSGTreeNode item) { return Hierarchy.SiblingIndexOf(CompactNodeID, item.CompactNodeID); }
204204

205205
/// <summary>Determines whether the <see cref="Chisel.Core.CSGTree"/> contains a specific value.</summary>

‎Core/1.Input/Nodes/CSGTreeBranch.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public bool InsertRange(int index, NativeArray<CSGTreeNode> array)
217217

218218
/// <summary>Determines the index of a specific child in the <see cref="Chisel.Core.CSGTreeBranch"/>.</summary>
219219
/// <param name="item">The <see cref="Chisel.Core.CSGTreeNode"/> to locate in the <see cref="Chisel.Core.CSGTreeBranch"/>.</param>
220-
/// <returns>The index of <paramref name="item"/> if found in the <see cref="Chisel.Core.CSGTreeBranch"/>; otherwise, –1.</returns>
220+
/// <returns>The index of <paramref name="item"/> if found in the <see cref="Chisel.Core.CSGTreeBranch"/>; otherwise, -1.</returns>
221221
[MethodImpl(MethodImplOptions.AggressiveInlining)]
222222
public int IndexOf (CSGTreeNode item) { return Hierarchy.SiblingIndexOf(CompactNodeID, item.CompactNodeID); }
223223

‎Core/2.Processing/Algorithms/MeshAlgorithms.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public void RemoveSelfIntersectingEdges()
410410
for (int i = 0; i < edgeCount; i++)
411411
removeFlags[i] = false;
412412

413-
// Mark any pair of non‐adjacent edges that intersect
413+
// Mark any pair of non-adjacent edges that intersect
414414
for (int i = 0; i < edgeCount; ++i)
415415
{
416416
int p1i = edgeIndices[i * 2 + 0];

‎Core/2.Processing/Cache/ChiselLookup.cs‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class Data
2424
public NativeList<BlobAssetReference<ChiselBrushRenderBuffer>> brushRenderBufferCache;
2525

2626
public NativeList<MinMaxAABB> brushTreeSpaceBoundCache;
27-
public NativeList<BlobAssetReference<BrushTreeSpacePlanes>> brushTreeSpacePlaneCache;
2827
public NativeList<BlobAssetReference<BrushesTouchedByBrush>> brushesTouchedByBrushCache;
2928
// Each brush as the exact CSG sees it (ExactBrush: exact planes, corners, bounds), rebuilt when the brush
3029
// changes (ExactInputJob).
@@ -72,7 +71,6 @@ internal void Initialize()
7271
basePolygonCache = new NativeList<BlobAssetReference<BasePolygonsBlob>>(1000, Allocator.Persistent); // Confirmed to get disposed
7372
treeSpaceVerticesCache = new NativeList<BlobAssetReference<BrushTreeSpaceVerticesBlob>>(1000, Allocator.Persistent); // Confirmed to get disposed
7473
routingTableCache = new NativeList<BlobAssetReference<RoutingTable>>(1000, Allocator.Persistent); // Confirmed to get disposed
75-
brushTreeSpacePlaneCache = new NativeList<BlobAssetReference<BrushTreeSpacePlanes>>(1000, Allocator.Persistent); // Confirmed to get disposed
7674
brushesTouchedByBrushCache = new NativeList<BlobAssetReference<BrushesTouchedByBrush>>(1000, Allocator.Persistent); // Confirmed to get disposed
7775
brushRenderBufferCache = new NativeList<BlobAssetReference<ChiselBrushRenderBuffer>>(1000, Allocator.Persistent); // Confirmed to get disposed
7876
exactBrushCache = new NativeList<BlobAssetReference<ExactBrush>>(1000, Allocator.Persistent);
@@ -115,8 +113,6 @@ internal void EnsureCapacity(int brushCount)
115113
if (routingTableCache.Capacity < brushCount)
116114
routingTableCache.Capacity = brushCount;
117115

118-
if (brushTreeSpacePlaneCache.Capacity < brushCount)
119-
brushTreeSpacePlaneCache.Capacity = brushCount;
120116

121117
if (brushesTouchedByBrushCache.Capacity < brushCount)
122118
brushesTouchedByBrushCache.Capacity = brushCount;
@@ -182,19 +178,6 @@ internal void Dispose()
182178
routingTableCache.Dispose();
183179
}
184180
routingTableCache = default;
185-
if (brushTreeSpacePlaneCache.IsCreated)
186-
{
187-
// Confirmed to be called
188-
for (int i = 0; i < brushTreeSpacePlaneCache.Length; i++)
189-
{
190-
if (brushTreeSpacePlaneCache[i].IsCreated)
191-
brushTreeSpacePlaneCache[i].Dispose();
192-
brushTreeSpacePlaneCache[i] = default;
193-
}
194-
brushTreeSpacePlaneCache.Clear();
195-
brushTreeSpacePlaneCache.Dispose();
196-
}
197-
brushTreeSpacePlaneCache = default;
198181
if (brushesTouchedByBrushCache.IsCreated)
199182
{
200183
// Confirmed to be called

0 commit comments

Comments
 (0)