API Reference > geometry-core > Curve > BagOfCurves BagOfCurves Class A BagOfCurves object is a collection of AnyCurve objects. A BagOfCurves has no implied properties such as being planar. Extends CurveCollection Methods Name Description constructor(): BagOfCurves Construct an empty BagOfCurves announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void invoke processor.announceBagOfCurves(this, indexInParent); cloneEmptyPeer(): BagOfCurves Return an empty BagOfCurves cloneStroked(options?: StrokeOptions): BagOfCurves Clone all children in stroked form. dgnBoundaryType(): number Return the boundary type (0) of a corresponding MicroStation CurveVector dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call handler.handleBagOfCurves(this) getChild(i: number): undefined | AnyCurve Get a child by index isSameGeometryClass(other: GeometryQuery): boolean test if other is an instance of BagOfCurves tryAddChild(child: undefined | AnyCurve): boolean Add a child create(...data: AnyCurve[]): BagOfCurves Static create with given curves. Inherited methods Name Inherited from Description checkForNonLinearPrimitives(): boolean CurveCollection return true if the curve collection has any primitives other than LineSegment3d and LineString3d clone(): undefined | CurveCollection CurveCollection Return a deep copy. cloneTransformed(transform: Transform): undefined | CurveCollection CurveCollection Create a deep copy of transformed curves. cloneWithExpandedLineStrings(): undefined | CurveCollection CurveCollection Create a deep copy with all linestrings expanded to multiple LineSegment3d. closestPoint(spacePoint: Point3d): undefined | CurveLocationDetail CurveCollection Return the closest point on the contained curves collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false): CurvePrimitive[] CurveCollection Return an array containing only the curve primitives. extendRange(rangeToExtend: Range3d, transform?: Transform): void CurveCollection Extend (increase) rangeToExtend as needed to include these curves (optionally transformed) isAlmostEqual(other: GeometryQuery): boolean CurveCollection test for exact structure and nearly identical geometry. maxGap(): number CurveCollection return the max gap between adjacent primitives in Path and Loop collections. range(transform?: Transform, result?: Range3d): Range3d CurveCollection return the range of the entire (tree) GeometryQuery sumLengths(): number CurveCollection Return the sum of the lengths of all contained curves. tryTransformInPlace(transform: Transform): boolean CurveCollection Apply transform recursively to children tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean CurveCollection try to move the geometry by dx,dy,dz areAlmostEqual(a: undefined | GeometryQuery, b: undefined | GeometryQuery): boolean Static CurveCollection apply instance method isAlmostEqual if both are defined. createCurveLocationDetailOnAnyCurvePrimitive(source: undefined | GeometryQuery, fraction: number = 0.5): undefined | CurveLocationDetail Static CurveCollection * Find any curve primitive in the source. Properties Name Type Description _children Protected AnyCurve[] Array of children. children Accessor ReadOnly AnyCurve[] Return the (reference to) array of children curveCollectionType Readonly "bagOfCurves" String name for schema properties Inherited properties Name Type Inherited from Description geometryCategory Readonly "curveCollection" CurveCollection String name for schema properties isAnyRegionType Accessor ReadOnly boolean CurveCollection Return true for planar region types:* Loop* ParityRegion* UnionRegion isClosedPath Accessor ReadOnly boolean CurveCollection Return true for a single-loop planar region type, i.e. Loop.* This is _not- a test for physical closure of a Path isInner boolean CurveCollection Flag for inner loop status. isOpenPath Accessor ReadOnly boolean CurveCollection Return true for a Path, i.e. a chain of curves joined head-to-tail Defined in curve/CurveCollection.ts Line 302 Last Updated: 12 June, 2024