AlternatingCCTreeNode Class

An AlternatingConvexClipTreeNode is a node in a tree structure in which

  • Each node contains a ConvexClipPlaneSet.
  • Each node contains an array of children which are also AlternatingConvexClipTreeNode.
  • The rule for an in/out decision is that a point is IN the subtree under a node if
    • It is IN the node's ConvexClipPlaneSet.
    • It is NOT IN any of the children.
  • Applying "NOT IN any of the children" locally to children at each level means that the ConvexClipPlaneSet at adjacent levels flip between being positive areas and holes.
  • Use an AlternatingConvexClipTreeNodeBuilder to construct the tree from a polygon.
  • It is possible for the root clip plane set to be empty. An empty clip plane set returns "true" for all point tests, so the meaning is just that holes are to be subtracted from the rest of space.
  • Although the interpretation of in/out alternates with tree levels, the ConvexClipPlaneSets at each level are all "enclosing" planes in the usual way.

Implements

Methods

Name Description
addEmptyChild(index0: number, numPoints: number): void Add a new child that has an empty plane set and given indices.  
addPlane(plane: ClipPlane): void Add a plane to the ConvexClipPlaneSet.  
appendCurveCollectionClipIntervals(curves: CurveCollection, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]): void Append start-end positions for curve intervals classified as inside or outside.  
appendCurvePrimitiveClipIntervals(curve: CurvePrimitive, insideIntervals: CurveLocationDetailPair[], outsideIntervals: CurveLocationDetailPair[]): void Append start-end positions for curve intervals classified as inside or outside.  
appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: ): void    
captureConvexClipPlaneSetAsVoid(child: AlternatingCCTreeNode): void Add an AlternatingConvexClipTreeNode as a child of this one -- i.e.  
clone(result?: AlternatingCCTreeNode): AlternatingCCTreeNode Creates a deep copy of this node (expensive - copies Geometry, and is recursive for children array).  
depth(): number    
empty(): void Resets this AlternatingConvexClipTreeNode to a newly-created state.  
extractLoops(): Point3d[][] Return an array with all the loops in the tree.  
isPointOnOrInside(point: Point3d): boolean Search with alternating in and out semantics.  
createHullAndInletsForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode Static Build the outer convex hull with inlets as first level children.  
createTreeForPolygon(points: Point3d[], result?: AlternatingCCTreeNode): AlternatingCCTreeNode Static
     
    createWithIndices(index0: number, numPoints: number, result?: AlternatingCCTreeNode): AlternatingCCTreeNode Static Initialize this node with index data referencing the parent polygon.  

    Properties

    Name Type Description
    children AlternatingCCTreeNode[]    
    numPoints number    
    planes ConvexClipPlaneSet    
    points Point3d[]    
    startIdx number    

    Defined in

    Last Updated: 17 December, 2024