A CurveVector is a collection of curve primitives. More...
#include <CurveVector.h>
Public Types | |
enum | BoundaryType { BOUNDARY_TYPE_None = 0, BOUNDARY_TYPE_Open = 1, BOUNDARY_TYPE_Outer = 2, BOUNDARY_TYPE_Inner = 3, BOUNDARY_TYPE_ParityRegion = 4, BOUNDARY_TYPE_UnionRegion = 5 } |
Classification of expected structure within a CurveVector. More... | |
enum | InOutClassification { INOUT_Unknown = 0, INOUT_In = 1, INOUT_Out = 2, INOUT_On = 3 } |
Classification of a point wrt a closed shape. More... | |
![]() | |
typedef ICurvePrimitivePtr | value_type |
typedef _Allocator | allocator_type |
typedef allocator_type::size_type | size_type |
typedef allocator_type::difference_type | difference_type |
typedef allocator_type::reference | reference |
typedef allocator_type::const_reference | const_reference |
typedef allocator_type::pointer | pointer |
typedef allocator_type::const_pointer | const_pointer |
typedef BC__RW::__rw_debug_iter < bvector, pointer, pointer > | iterator |
typedef BC__RW::__rw_debug_iter < bvector, const_pointer, pointer > | const_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
typedef std::reverse_iterator < iterator > | reverse_iterator |
Public Member Functions | |
ICurvePrimitive::CurvePrimitiveType | HasSingleCurvePrimitive () const |
Return true if the curve vector has a single element and that element is a primitive. More... | |
BoundaryType | GetBoundaryType () const |
Return the type code indicating whether the vector is a path, outer boundary, inner boundary, or higher level grouping. More... | |
bool | IsOpenPath () const |
Query: Is this an open path? More... | |
bool | IsClosedPath () const |
Query: Is this (single) closed path? More... | |
bool | IsParityRegion () const |
Query: Is this a collection of loops with parity rules? More... | |
bool | IsUnionRegion () const |
Query: is this a collection of areas with union rules? More... | |
bool | IsAnyRegionType () const |
Query: is this any closed area type (single, parity, union) More... | |
bool | AreStartEndAlmostEqual () const |
Query: Does this have start and end points and are the points almost equal? More... | |
bool | IsEllipticDisk (DEllipse3dR ellipse) const |
Query: Is this an outer loop with an ellipse as its only curve? More... | |
bool | IsPhysicallyClosedPath () const |
Query: Is this a nominally open path but with matching start and end? More... | |
bool | IsRectangle (TransformR localToWorld, TransformR worldToLocal) const |
Query: Is this a rectangle? More... | |
bool | SwapAt (size_t index0, size_t index1) |
Swap the entries at given indices. Return false if either index is out of bounds. More... | |
void | SwapContents (CurveVectorR other) |
Swap bvectors and type. More... | |
CurveVectorPtr | Clone () const |
Return a "deep copy". More... | |
CurveVectorPtr | CloneDereferenced (bool allowExtrapolation=false, bool maximumDeref=true) const |
Return a "deep copy" with PartialCurve primitives replaced by full curves. More... | |
CurveVectorPtr | CloneWithFillets (double radius) const |
return a (deep) clone with fillets inserted between successive curves. More... | |
CurveVectorPtr | CloneWithGapsClosed (CurveGapOptionsCR options) const |
return a (deep) clone with endpoint gaps closed. More... | |
size_t | AddPrimitives (CurveVectorCR source) |
recurse through source. append all leaf primitives to this. Return number added. More... | |
void | Add (ICurvePrimitivePtr child) |
add single curve primitive More... | |
void | Add (CurveVectorPtr child) |
wrap as child curve primitive and add to this vector More... | |
CurveVectorPtr | CloneWithBlends (BlendType, double radiusA, double radiusB) const |
return a (deep) clone with fillets inserted between successive curves. More... | |
CurveVectorPtr | CloneOffsetCurvesXY (CurveOffsetOptionsCR options) |
return a (deep) clone with all curves offset by signed distance. More... | |
CurveVectorPtr | AreaOffset (CurveOffsetOptionsCR options) const |
return a (deep) clone with all areas increased or decreased according to the offset distance. More... | |
size_t | CountPrimitivesOfType (ICurvePrimitive::CurvePrimitiveType targetType) const |
Count primitives of specified type. More... | |
CurveVectorPtr | CloneWithSplits (CurveVectorCR splitterCurves, bool primitivesOnly=false) |
Return a curve vector that is a clone, but with all primitives split at intersections with any splitter curve. More... | |
void | AppendSplitCurvesByRegion (CurveVectorCR region, CurveVectorP insideCollector, CurveVectorP outsideCollector, CurveVectorP onCollector) |
Return curves (not regions) that are inside, outside, or on a region. More... | |
void | AppendSplitCurvesByPlane (DPlane3dCR plane, CurveVectorP belowCollector, CurveVectorP aboveCollector, CurveVectorP onCollector) |
Return curves (not regions) that are below, above, and on a plane. More... | |
CurveVectorPtr | CloneWithExplodedLinestrings () const |
Return a curve vector that is a clone, but with all polylines split into individual line segments. More... | |
bool | WireCentroid (double &length, DPoint3dR centroid) const |
Return the centroid of the contained curves, considered as wires. More... | |
bool | CentroidNormalArea (DPoint3dR centroid, DVec3dR normal, double &area) const |
Return the centroid, normal and area of the curve vector. More... | |
bool | ComputeSecondMomentAreaProducts (DMatrix4dR products) const |
Return the area, centroid, orientation, and principal moments, treating this as a thin planar sheet. More... | |
bool | ComputeSecondMomentDifferentialAreaRotationProducts (DRay3dCR rotationAxis, TransformR rotationToWorld, DMatrix4dR products) const |
Return the moment products [xx,xy,xz,xw; etc] of the area as a differential rotational slice. More... | |
bool | ComputeSecondMomentDifferentialWireRotationProducts (DRay3dCR rotationAxis, TransformR rotationToWorld, DMatrix4dR products) const |
Return the moment products [xx,xy,xz,xw; etc] of the wire as a differential rotational contribution. More... | |
bool | ComputeSecondMomentWireProducts (DMatrix4dR products) const |
Return the area, centroid, orientation, and principal moments, treating this as a wire. More... | |
bool | CentroidAreaXY (DPoint3dR centroid, double &area) const |
Return the centroid and area of the curve vector as viewed in the xy plane. More... | |
DRange1d | ProjectedParameterRange (DRay3dCR ray) const |
Return the range of ray parameters when contents of the CurveVector are projected to a ray. More... | |
CurveVectorPtr | CloneInLocalCoordinates (LocalCoordinateSelect frameType, TransformR localToWorld, TransformR worldToLocal, DRange3dR localRange) const |
Return curve copy and transforms for a local coordinate system related to the curves. More... | |
bool | GetAnyFrenetFrame (TransformR frame) const |
Deep search for any curve primitive that has a well defined coordinate frame. More... | |
bool | GetAnyFrenetFrame (TransformR frame, int searchPreference) const |
Deep search for any curve primitive that has a well defined coordinate frame. More... | |
bool | TryUVFractionToXYZ (double uFraction, double vFraction, DPoint3dR xyz, DVec3dR dXdu, DVec3dR dXdv) const |
convert u,v fraction to xyz and derivatives. More... | |
CurveVectorPtr | CloneAsBsplines () const |
Return a "deep copy" with primitives replaced by bsplines The tree upper levels of the tree structure are retained – i.e. More... | |
CurveVectorPtr | Stroke (IFacetOptionsR options) const |
Return a "deep copy" with primitives replaced by strokes. More... | |
void | AddStrokePoints (bvector< DPoint3d > &points, IFacetOptionsR options) const |
Add stroke points form all children to output. More... | |
bool | CollectLinearGeometry (bvector< bvector< bvector< DPoint3d >>> ®ionsPoints) const |
Add all strokes from the structure. More... | |
bool | AddSpacedPoints (bvector< double > const &distances, bvector< CurveLocationDetail > &locations) const |
Compute points at (many) specified distances along the (many) curves in the CurveVector. More... | |
BentleyStatus | ToBsplineCurve (MSBsplineCurveR curve) const |
Represent a curve vector that denotes an open or closed path as a single bspline curve. More... | |
MSBsplineCurvePtr | GetBsplineCurve () const |
Represent a curve vector that denotes an open or closed path as a single bspline curve. More... | |
bool | ClosestPointBounded (DPoint3dCR spacePoint, CurveLocationDetailR location) const |
Search for the closest point on any contained curve. More... | |
bool | ClosestPointBounded (DPoint3dCR spacePoint, CurveLocationDetailR location, bool extend0, bool extend1) const |
Search for the closest point on any contained curve. More... | |
bool | ClosestPointBoundedXY (DPoint3dCR spacePoint, DMatrix4dCP worldToLocal, CurveLocationDetailR location) const |
Search for the closest point on any contained curve, using only xy (viewed) coordinates. More... | |
bool | ClosestPointBoundedXY (DPoint3dCR spacePoint, DMatrix4dCP worldToLocal, CurveLocationDetailR location, bool extend0, bool extend1) const |
Search for the closest point on any contained curve, using only xy (viewed) coordinates, optionally allowing extensions from free ends of lines and arcs. More... | |
CurveVector::InOutClassification | ClosestCurveOrRegionPoint (DPoint3dCR spacePoint, DPoint3dR curveOrRegionPoint) const |
Search for closest point on curve. More... | |
void | AnnounceKeyPoints (DPoint3dCR spacePoint, CurveKeyPointCollector &collector, bool extend0, bool extend1) const |
Search for various keypoints (as requested by the collector) During recursion, extension bits are changed to false for interior points of paths. More... | |
bool | GetStartEnd (DPoint3dR pointA, DPoint3dR pointB) const |
Return first/last among children. More... | |
bool | GetStartEnd (DPoint3dR pointA, DPoint3dR pointB, DVec3dR unitTangentA, DVec3dR unitTangentB) const |
Return start and end points and the (normalized!) tangents among children. More... | |
bool | GetStartPoint (DPoint3dR point) const |
Return start point of the primitive (or first primitive in deep search) More... | |
double | Length () const |
Sum lengths of contained curves. More... | |
double | Length (RotMatrixCP worldToLocal) const |
Sum lengths of contained curves with transform applied. More... | |
double | FastLength () const |
Sum lengths of contained curves, using fast method that may overestimate the length but is reasonable for setting tolerances. More... | |
double | MaxGapWithinPath () const |
Maximum gap distance between end of primitive and start of its successor within Open, outer, or Inner loop. More... | |
double | FastMaxAbs () const |
Return a fast estimate of the maximum absoluted value in any coordinate. This will examine all curves, but is allowed to use safe approximations like bspline pole coordinates instead of exact curve calculations. More... | |
bool | IsSameStructure (CurveVectorCR other) const |
Recursive check for structural match (tree structure and leaf type) with the other curve vector. More... | |
bool | IsSameStructureAndGeometry (CurveVectorCR other, double tolerance=0.0) const |
Recursive check for match (tree structure. More... | |
bool | GetRange (DRange3dR range) const |
Return the xyz range of contained curves. More... | |
bool | GetRange (DRange3dR range, TransformCR transform) const |
Compute range of transformed structure. More... | |
bool | IsPlanar (TransformR localToWorld, TransformR worldToLocal, DRange3dR range) const |
Test if the contained curves are planar. More... | |
bool | IsPlanarWithDefaultNormal (TransformR localToWorld, TransformR worldToLocal, DRange3dR range, DVec3dCP normal) const |
Test if the contained curves are planar. More... | |
size_t | CyclicIndex (int index) const |
return mod of index with vector length, properly corrected for negatives. More... | |
ICurvePrimitivePtr | GetCyclic (ptrdiff_t index) const |
return child at cyclic index, propertly corrected for negatives. More... | |
size_t | CurveLocationDetailIndex (CurveLocationDetail const &location) const |
return index of curve location detail in vector (only valid for a vector that is a single open or closed path). More... | |
size_t | FindIndexOfPrimitive (ICurvePrimitiveCP primitive) const |
return index of primitive in vector (only valid for a vector that is a single open or closed path). More... | |
CurveVectorPtr | FindParentOfPrimitive (ICurvePrimitiveCP primitive) const |
Search the tree (below the calling instance) for the curve vector which is the immediate parent of given primitive. More... | |
int | CurveLocationDetailCompare (CurveLocationDetail const &location0, CurveLocationDetail const &location1) const |
return 0 of locations are equal, -1 if location 0 is less than location 1, and 1 if location 0 > location 1. More... | |
double | ResolveTolerance (double tolerance) const |
return larger of given tolerance and default tolerance based on FastMasAbs of contents ... More... | |
void | FindPrimitivesWithNearbyStartEnd (bvector< CurveLocationDetail > &data, DPoint3dCR xyz, double tolerance) const |
Search for children whose start or end is close to a search point. More... | |
CurveVectorPtr | CloneBetweenCyclicIndexedFractions (int index0, double fraction0, int index1, double fraction1) const |
Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices interpretted cyclically. More... | |
CurveVectorPtr | CloneBetweenDirectedFractions (int index0, double fraction0, int index1, double fraction1, bool allowExtrapolation) const |
Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices restricted to array bounds. More... | |
CurveVectorPtr | CloneReversed () const |
Return a new curve vector that has all components reversed. More... | |
CurveVectorPtr | GenerateAllParts (int indexA, double fractionA, int indexB, double fractionB) const |
Return a CurveVector (BOUNDARY_TYPE_None) which is a collection of open CurveVectors that collectively contain all parts of the input For (indexA,fractionA) prededing (indexB,fractionB) the output traces the input in the forward direction and has the following possibilities (of which null ones are skipped) ul> li> BOUNDARY_TYPE_Open - (A B), (B to end), (start to A) li> BOUNDARY_TYPE_Inner or BOUNDARY_TYPE_Outer - (A B), (B to where A appears in the next period) li> BOUNDARY_TYPE_ParityRegion, BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_None – no output. More... | |
bool | ContainsNonLinearPrimitive () const |
Return true if CurveVector has a component that is not a line or linestring. More... | |
void | AppendCurvePlaneIntersections (DPlane3dCR plane, bvector< CurveLocationDetailPair > &intersections, double tolerance=0.0) const |
Compute simple points of intersection of the curve with a plane. More... | |
bool | AppendClosedCurvePlaneIntersections (DPlane3dCR plane, bvector< CurveLocationDetailPair > &intersections, double tolerance=0.0) const |
Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules. More... | |
ICurvePrimitivePtr | PlaneSection (DPlane3dCR plane, double tolerance=0.0) const |
Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules. More... | |
CurveVector::InOutClassification | PointInOnOutXY (DPoint3dCR xyz) const |
Test if a point is in, on, or outside when looking at xy plane. More... | |
CurveVector::InOutClassification | RayPierceInOnOut (DRay3dCR ray, SolidLocationDetailR hitDetail) const |
Test for a ray hit in the curve vector's planar region. More... | |
bool | TransformInPlace (TransformCR transform) |
Apply a transform to all contained curves. More... | |
bool | ReverseCurvesInPlace () |
Recursively reverse. More... | |
void | ConsolidateAdjacentPrimitives () |
Inplace update to consolidate contiguous parts. More... | |
void | ConsolidateAdjacentPrimitives (bool doSimplifyLinestrings) |
Inplace update to consolidate contiguous parts. More... | |
void | SimplifyLinestrings (double distanceTol, bool eliminateOverdraw, bool wrap) |
Inplace update to consolidate colinear interior points of linestrings. More... | |
bool | FixupXYOuterInner (bool fullGeometryCheck=false) |
Update order, boundary type, and direction of contained loops. More... | |
double | ReorderForSmallGaps () |
Reorder curve primitives to produce small head-to-tail gaps. More... | |
CurveVectorPtr | AssembleChains () |
Join curve primitives head to tail. More... | |
![]() | |
iterator | _C_make_iter (pointer __ptr) |
const_iterator | _C_make_iter (pointer __ptr) const |
bvector (const allocator_type &__alloc=allocator_type()) | |
bvector (size_type __n, const_reference __x=value_type(), const allocator_type &__alloc=allocator_type()) | |
bvector (_InputIter __first, _InputIter __last, const allocator_type &__alloc=allocator_type()) | |
bvector (const bvector &__rhs) | |
bvector (bvector &&rhs) | |
bvector & | operator= (bvector &&rhs) |
bvector & | operator= (const bvector &) |
~bvector () | |
void | assign (_InputIter __first, _InputIter __last) |
void | assign (size_type __n, const_reference __x) |
allocator_type | get_allocator () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
size_type | max_size () const |
void | resize (size_type, value_type=value_type()) |
size_type | capacity () const |
bool | empty () const |
void | reserve (size_type) |
reference | operator[] (size_type) |
const_reference | operator[] (size_type) const |
reference | at (size_type) |
const_reference | at (size_type __n) const |
reference | front () |
const_reference | front () const |
pointer | data () |
const_pointer | data () const |
reference | back () |
const_reference | back () const |
void | push_back (const_reference) |
void | pop_back () |
iterator | insert (iterator, const_reference) |
void | insert (iterator __it, _InputIter __first, _InputIter __last) |
void | insert (iterator __it, size_type __n, const_reference __x) |
iterator | erase (iterator) |
iterator | erase (iterator, iterator) |
void | swap (bvector &) |
void | clear () |
Static Public Member Functions | |
static CurveVectorPtr | Create (BoundaryType boundaryType) |
Create a curve vector with given boundary type and no members. More... | |
static CurveVectorPtr | Create (BoundaryType boundaryType, ICurvePrimitivePtr primitive) |
Create a curve vector with a single primitive and given boundary type. More... | |
static CurveVectorPtr | CreateLinear (bvector< DPoint3d > const &points, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open, bool forceXYOrientation=false) |
Create a linestring or polygon from xyz data. More... | |
static CurveVectorPtr | CreateLinear (DPoint3dCP points, size_t numPoints, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open, bool forceXYOrientation=false) |
Create a linestring or polygon from xyz data. More... | |
static CurveVectorPtr | CreateLinear (DPoint2dCP points, size_t numPoints, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open, bool forceXYOrientation=false) |
Create a linestring or polygon from xyz data. More... | |
static CurveVectorPtr | CreateRectangle (double x0, double y0, double x1, double y1, double z, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Outer) |
Create a rectangle from xy corners. More... | |
static CurveVectorPtr | Create (bvector< DSegment3d > const &segments) |
Create a BOUNDARY_TYPE_None with line segments. More... | |
static CurveVectorPtr | CreateDisk (DEllipse3dCR arc, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Outer, bool forceXYOrientation=false) |
Create a (deep) curve vector structure for a complete elliptic (circular) disk. More... | |
static CurveVectorPtr | Create (ICurvePrimitivePtr child, BoundaryType boundaryType=CurveVector::BOUNDARY_TYPE_Open) |
Create a single level curve vector structure with a single primitive. More... | |
static CurveVectorPtr | AreaUnion (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL) |
Return a curve vector containing the union of input areas. More... | |
static CurveVectorPtr | AreaDifference (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL) |
Return a curve vector containing the difference of input areas. More... | |
static CurveVectorPtr | AreaIntersection (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL) |
Return a curve vector containing the intersection of input areas. More... | |
static CurveVectorPtr | AreaParity (CurveVectorCR regionA, CurveVectorCR regionB, CurvePrimitivePtrPairVector *newToOld=NULL) |
Return a curve vector containing the parity of input areas. More... | |
static CurveVectorPtr | AreaAnalysis (CurveVectorCR region, AreaSelect select1, BoolSelect select2, bool reverse) |
Return a curve vector containing the "inside" areas by various conditions. More... | |
static CurveVectorPtr | ReduceToCCWAreas (CurveVectorCR regionA) |
Return a curve vector containing only clockwise areas. More... | |
static CurveVectorPtr | CreateXYHatch (CurveVectorCR boundary, DPoint3dCR startPoint, double angleRadians, double spacing, int selection=0) |
Return a curve vector (of type BOUNDARY_TYPE_None) containing hatch sticks. More... | |
static CurveVectorPtr | CreateSpiralLineToLineShift (int transitionType, DPoint3dCR pointA, DPoint3dCR shoulderB, DPoint3dCR shoulderC, DPoint3dCR pointD) |
Return a curveVector with spiral transition between two lines, with shoulder points controlling the spiral max curvatures. More... | |
static CurveVectorPtr | ConstructSpiralArcSpiralTransition (DPoint3dCR xyz0, DPoint3dCR xyz1, DPoint3dCR xyz2, double arcRadius, double spiralLength) |
Return a curveVector with spiral-arc-spiral transtion between two lines, subject to: ul> li>specified arcRadiius for central part li>specified spiralLength for both entry and exit. More... | |
static CurveVectorPtr | ConstructSpiralArcSpiralTransitionPseudoOffset (DPoint3dCR primaryPoint0, DPoint3dCR primaryPoint1, DPoint3dCR primaryPoint2, double primaryRadius, double primarySpiralLength, double offsetDistance) |
Construct a spiral-arc-spiral transition that is an (approximate) offset of a primary transition. More... | |
A CurveVector is a collection of curve primitives.
The collection has a type code that indicates whether it acts as an open chain, single loop (inner or outer), or a parent of multiple loops.
This can represent paths, loops, multiloop parity regions, and multi-region collections.
A CurveVector is a refcounted structure. At point of creation, a curve vector is addressed via a CurveVectorPtr. Inputs to methods can be passed as simple references and pointers.
open chain:
(CurveVector::BOUNDARY_TYPE_OPEN prim1 prim2 ... primN)
single loop:
(CurveVector::BOUNDARY_TYPE_OUTER prim1 prim2 ... primN)
multiloop region:
(CurveVector::BOUNDARY_TYPE_UNION_REGION (CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN) (CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN) (CurveVector::BOUNDARY_TYPE_INNER prim1 ... primN) )
(CurveVector::BOUNDARY_TYPE_UNION_REGION // the direct children of this CurveVector may be any set of Outer and ParityReigion (CurveVector:ParityRegion (CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN) (CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN) (CurveVector::BOUNDARY_TYPE_INNER prim1 ... primN) ) (CurveVector::BOUNDARY_TYPE_OUTER prim1 prim2 ... primN) )
A parity region is a collection of unordered loops. A point moving in the plane transitions from "in" to "out" (or vice versa) any time it crosses a curve.
This definition of inside and outside is well defined even if ( a) the loops cross each other, ( b) self-intersection within a loop, ( c) any order of presentation of the loops.
In the usual case wheret here is a single outer loop and one or more hole loops, it is customary to store the outer loop first followed by holes, with the outer loop counterclockwise and inner loops clockwise.
Warning: Computational code that requires signed loops (e.g. area calculations) assumes that the largest loop is outer and others are inner.
enum BoundaryType |
Classification of expected structure within a CurveVector.
Enumerator | |
---|---|
BOUNDARY_TYPE_None |
no specific properties expected for contained curves or points.
|
BOUNDARY_TYPE_Open |
Curves should join head to tail in a single path. The path is not expected to be closed. |
BOUNDARY_TYPE_Outer |
Curves should join head to tail in a single closed path; this area expected to be an outer (or only) loop. |
BOUNDARY_TYPE_Inner |
Curves should join head to tail in a single closed path; this area is expected to be an inner loop. |
BOUNDARY_TYPE_ParityRegion |
Expected to contain (only) multiple CurveVectors, all of which are either BOUNDARY_TYPE_Open or BOUNDARY_TYPE_inner. (No individual curves or open paths). These are to be analyzed by partity rules. |
BOUNDARY_TYPE_UnionRegion |
Expected to contain (only) multiple CurveVectors, all of which have area. (No individual curves or open paths). These are to be analyzed by union rules. |
enum InOutClassification |
void Add | ( | ICurvePrimitivePtr | child | ) |
add single curve primitive
void Add | ( | CurveVectorPtr | child | ) |
wrap as child curve primitive and add to this vector
size_t AddPrimitives | ( | CurveVectorCR | source | ) |
recurse through source. append all leaf primitives to this. Return number added.
bool AddSpacedPoints | ( | bvector< double > const & | distances, |
bvector< CurveLocationDetail > & | locations | ||
) | const |
Compute points at (many) specified distances along the (many) curves in the CurveVector.
Intervals between successive distances can "jump" from one curve to the next. If curves to not connect head to tail, the gap is NOT filled – measurement just picks up after the gap.
[in] | distances | vector of distances, all measured from the start of the first primitive. |
[out] | locations | vector of locations. (This is NOT cleared at start – points are just added.) |
void AddStrokePoints | ( | bvector< DPoint3d > & | points, |
IFacetOptionsR | options | ||
) | const |
Add stroke points form all children to output.
Strokes from all children are concatenated into the same vector, separated only by DISCONNECT points. Use Stroke() to get structured strokes.
[in,out] | points | growing vector of strokes. |
[in] | options | optiosn for stroke density. chordTolerance, angleTolerance, and maxEdgeLength will be used. |
void AnnounceKeyPoints | ( | DPoint3dCR | spacePoint, |
CurveKeyPointCollector & | collector, | ||
bool | extend0, | ||
bool | extend1 | ||
) | const |
Search for various keypoints (as requested by the collector) During recursion, extension bits are changed to false for interior points of paths.
[in] | spacePoint | point to project |
[in] | collector | object to receive keypoint announcements |
[in] | extend0 | true to extend from start. |
[in] | extend1 | true to extend from end. |
bool AppendClosedCurvePlaneIntersections | ( | DPlane3dCR | plane, |
bvector< CurveLocationDetailPair > & | intersections, | ||
double | tolerance = 0.0 |
||
) | const |
Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules.
Intersectoins are reported as CurveLocationDetailPairs for start and end of segments.
[in] | plane | |
[out] | intersections | intersection details |
[in] | tolerance | for on-plane decisions. If 0, a tolerance is computed based on the coordinates in the curve. |
void AppendCurvePlaneIntersections | ( | DPlane3dCR | plane, |
bvector< CurveLocationDetailPair > & | intersections, | ||
double | tolerance = 0.0 |
||
) | const |
Compute simple points of intersection of the curve with a plane.
Single point intersection appears as a CurveLocationDetailPair with identical locations for both parts of the pair (SameCurveAndFraction) Curve-on-plane appears as CurveLocationDetailPair with curve,fraction data for start and end of on-plane sections.
[in] | plane | |
[out] | intersections | intersection details |
[in] | tolerance | for on-plane decisions. If 0, a tolerance is computed based on the coordinates in the curve. |
void AppendSplitCurvesByPlane | ( | DPlane3dCR | plane, |
CurveVectorP | belowCollector, | ||
CurveVectorP | aboveCollector, | ||
CurveVectorP | onCollector | ||
) |
Return curves (not regions) that are below, above, and on a plane.
void AppendSplitCurvesByRegion | ( | CurveVectorCR | region, |
CurveVectorP | insideCollector, | ||
CurveVectorP | outsideCollector, | ||
CurveVectorP | onCollector | ||
) |
Return curves (not regions) that are inside, outside, or on a region.
|
static |
Return a curve vector containing the "inside" areas by various conditions.
[in] | region | Region that may have loops back over its area. |
[in] | select1 | Rule for classifying single area: one of AreaSelect_Parity, AreaSelect_CCWPositiveWindingNumber, AreaSelect_CCWNonzeroWindingNumber, AreaSelect_CCWNegativeWindingNumber |
[in] | select2 | Rule for combining leaf left results: One of BoolSelect_Parity, BoolSelect_Union, BoolSelect_Sum_Parity, BoolSelect_CCWPositiveWindingNumber, BoolSelect_CCWNonzeroWindingNumber, BoolSelect_CCWNegativeWindingNumber |
[in] | reverse | to return the opposite set of faces. |
|
static |
Return a curve vector containing the difference of input areas.
[in] | regionA | left operand |
[in] | regionB | right operand |
[in,out] | newToOld | (optional) pointer to bvector to receive paring of new and old curves. |
|
static |
Return a curve vector containing the intersection of input areas.
[in] | regionA | left operand |
[in] | regionB | right operand |
[in,out] | newToOld | (optional) pointer to bvector to receive paring of new and old curves. |
CurveVectorPtr AreaOffset | ( | CurveOffsetOptionsCR | options | ) | const |
return a (deep) clone with all areas increased or decreased according to the offset distance.
|
static |
Return a curve vector containing the parity of input areas.
[in] | regionA | left operand |
[in] | regionB | right operand |
[in,out] | newToOld | (optional) pointer to bvector to receive paring of new and old curves. |
|
static |
Return a curve vector containing the union of input areas.
[in] | regionA | left operand |
[in] | regionB | right operand |
[in,out] | newToOld | (optional) pointer to bvector to receive paring of new and old curves. |
bool AreStartEndAlmostEqual | ( | ) | const |
Query: Does this have start and end points and are the points almost equal?
CurveVectorPtr AssembleChains | ( | ) |
Join curve primitives head to tail.
Return a top level BOUNDARY_TYPE_None containing the various BOUNDARY_TYPE_Open and BOUNDARY_TYPE_Outer
bool CentroidAreaXY | ( | DPoint3dR | centroid, |
double & | area | ||
) | const |
Return the centroid and area of the curve vector as viewed in the xy plane.
return false if the CurveVector is not one of the area types (union region, parity region, or closed loop)
[out] | centroid | curve centroid |
[out] | area | area of region. |
bool CentroidNormalArea | ( | DPoint3dR | centroid, |
DVec3dR | normal, | ||
double & | area | ||
) | const |
Return the centroid, normal and area of the curve vector.
return false if the CurveVector is not one of the area types (union region, parity region, or closed loop)
[out] | centroid | curve centroid |
[out] | normal | curve normal |
[out] | area | area of region. |
CurveVectorPtr Clone | ( | ) | const |
Return a "deep copy".
CurveVectorPtr CloneAsBsplines | ( | ) | const |
Return a "deep copy" with primitives replaced by bsplines The tree upper levels of the tree structure are retained – i.e.
the output contains corresponding tree structure ParityRegion, UnionRegion, OuterLoop, and InnerLoop ul> li>UnionRegion and ParityRegion vectors: Create a new CurveVector of the same type. Recursively create children. li>OuterLoop, InnerLoop, OpenPath: Create a new curve vector of the same type. li>Primitives: Each primtitive is copied as a bspline curve primitive. /ul>
CurveVectorPtr CloneBetweenCyclicIndexedFractions | ( | int | index0, |
double | fraction0, | ||
int | index1, | ||
double | fraction1 | ||
) | const |
Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices interpretted cyclically.
CurveVectorPtr CloneBetweenDirectedFractions | ( | int | index0, |
double | fraction0, | ||
int | index1, | ||
double | fraction1, | ||
bool | allowExtrapolation | ||
) | const |
Return a new vector containing curves from index0,fraction0 to index1,fraction1 with the (signed int!!) indices restricted to array bounds.
CurveVectorPtr CloneDereferenced | ( | bool | allowExtrapolation = false , |
bool | maximumDeref = true |
||
) | const |
Return a "deep copy" with PartialCurve primitives replaced by full curves.
[in] | maximumDeref | true to recurse through all steps of PartialCurve chains |
[in] | allowExtrapolation | true to allow extension before/after endpoints. |
CurveVectorPtr CloneInLocalCoordinates | ( | LocalCoordinateSelect | frameType, |
TransformR | localToWorld, | ||
TransformR | worldToLocal, | ||
DRange3dR | localRange | ||
) | const |
Return curve copy and transforms for a local coordinate system related to the curves.
The local x and y axes are parallel to the x and y axes of the frenet frame at the curve start.
[out] | localToWorld | local to world transform |
[out] | worldToLocal | worldTolocal transform |
[out] | localRange | curve vector range in the local frame. |
[in] | frameType | Selects how the geometry size is represented in the scale. ul> li>LOCAL_COORDINATE_SCALE_UnitAxesAtStart – x,y,z columns in the transform are unit vectors. localRange values are true geometry sizes. origin is at start point of first primitive. li>LOCAL_COORDINATE_SCALE_UnitAxesAtLowerLeft – x,y,z columns in the transform are unit vectors. localRange values are true geometry sizes. origin is at lower left of range. li>LOCAL_COORDINATE_SCALE_01RangeBothAxes – x column is a vector spanning the x range from min to max. y column is a vector spanning the y range from min to max. localRange values are 0..1 (inclusive) in both directions. origin is at lower left of range. li>LOCAL_COORDINATE_SCALE_01RangeLargerAxis – x and y columns have the same length, large enough to span the larger direction. localRange values are 0..1 in the larger direction, 0..f in the smaller direction, where f is that direction's size as a fraction of the larger direction. origin is at lower left of range. /ul> |
CurveVectorPtr CloneOffsetCurvesXY | ( | CurveOffsetOptionsCR | options | ) |
return a (deep) clone with all curves offset by signed distance.
This is a curve operation, and may result in self-intersecting offset curves.
CurveVectorPtr CloneReversed | ( | ) | const |
Return a new curve vector that has all components reversed.
CurveVectorPtr CloneWithBlends | ( | BlendType | , |
double | radiusA, | ||
double | radiusB | ||
) | const |
return a (deep) clone with fillets inserted between successive curves.
CurveVectorPtr CloneWithExplodedLinestrings | ( | ) | const |
Return a curve vector that is a clone, but with all polylines split into individual line segments.
CurveVectorPtr CloneWithFillets | ( | double | radius | ) | const |
return a (deep) clone with fillets inserted between successive curves.
CurveVectorPtr CloneWithGapsClosed | ( | CurveGapOptionsCR | options | ) | const |
return a (deep) clone with endpoint gaps closed.
When gaps are found larger than gapTolerance, line segments are added. The options that will be used are: 1) options.SetEqualPointTolerance(value): Gaps smaller than this are acceptable. This Suggested value: around 1e-7 in master units. 2) options.SetMaxDirectAdjustTolerance: gaps this small may be closed by directly moving endopints of lines or linestrings. SuggestedValue: 10 to 1000 times the equal point tolerance 3) options.SetRemovePriorGapPrimitives(true): primitives marked as gaps are purged. (And the gaps are re-closed) Suggested value: true. (default is true) 4) options.SetMaxAdjustAlongPrimitive: points may move this far if the final point is on the extended element.
CurveVectorPtr CloneWithSplits | ( | CurveVectorCR | splitterCurves, |
bool | primitivesOnly = false |
||
) |
Return a curve vector that is a clone, but with all primitives split at intersections with any splitter curve.
Optionally omit tree structure and only copy primitives.
CurveVector::InOutClassification ClosestCurveOrRegionPoint | ( | DPoint3dCR | spacePoint, |
DPoint3dR | curveOrRegionPoint | ||
) | const |
Search for closest point on curve.
If CV is a region type, also look for projection onto interior of the region.
[in] | spacePoint | fixed point of search |
[out] | curveOrRegionPoint | computed point on curve or region interior. |
bool ClosestPointBounded | ( | DPoint3dCR | spacePoint, |
CurveLocationDetailR | location | ||
) | const |
Search for the closest point on any contained curve.
bool ClosestPointBounded | ( | DPoint3dCR | spacePoint, |
CurveLocationDetailR | location, | ||
bool | extend0, | ||
bool | extend1 | ||
) | const |
Search for the closest point on any contained curve.
bool ClosestPointBoundedXY | ( | DPoint3dCR | spacePoint, |
DMatrix4dCP | worldToLocal, | ||
CurveLocationDetailR | location | ||
) | const |
Search for the closest point on any contained curve, using only xy (viewed) coordinates.
bool ClosestPointBoundedXY | ( | DPoint3dCR | spacePoint, |
DMatrix4dCP | worldToLocal, | ||
CurveLocationDetailR | location, | ||
bool | extend0, | ||
bool | extend1 | ||
) | const |
Search for the closest point on any contained curve, using only xy (viewed) coordinates, optionally allowing extensions from free ends of lines and arcs.
Add all strokes from the structure.
This is intended to be called on structures with only lines and linestrings. The outer curve vector may be a single loop, parity region, or union region. AddLinearLoops recurses The regionsPoints[i] is an array of loops. regionsPoints[i][j] is loop j of regionsPoints[i].
bool ComputeSecondMomentAreaProducts | ( | DMatrix4dR | products | ) | const |
Return the area, centroid, orientation, and principal moments, treating this as a thin planar sheet.
[out] | products | integrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA |
bool ComputeSecondMomentDifferentialAreaRotationProducts | ( | DRay3dCR | rotationAxis, |
TransformR | rotationToWorld, | ||
DMatrix4dR | products | ||
) | const |
Return the moment products [xx,xy,xz,xw; etc] of the area as a differential rotational slice.
[in] | rotationAxis | the origin and z axis of the rotation. |
[out] | rotationToWorld | transformation from rotation system (origin on rotation axis) to world. The products are base don local coordinates in the system. |
[out] | products | products in the rotation system. |
bool ComputeSecondMomentDifferentialWireRotationProducts | ( | DRay3dCR | rotationAxis, |
TransformR | rotationToWorld, | ||
DMatrix4dR | products | ||
) | const |
Return the moment products [xx,xy,xz,xw; etc] of the wire as a differential rotational contribution.
[in] | rotationAxis | the origin and z axis of the rotation. |
[out] | rotationToWorld | transformation from rotation system (origin on rotation axis) to world. The products are base don local coordinates in the system. |
[out] | products | products in the rotation system. |
bool ComputeSecondMomentWireProducts | ( | DMatrix4dR | products | ) | const |
Return the area, centroid, orientation, and principal moments, treating this as a wire.
[out] | products | integrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA |
void ConsolidateAdjacentPrimitives | ( | ) |
Inplace update to consolidate contiguous parts.
Adjacent lines and linestrings become a single linestring. Interior colinear points of linestrings are eliminated. Adjacent and compatible arcs become single arc.
void ConsolidateAdjacentPrimitives | ( | bool | doSimplifyLinestrings | ) |
Inplace update to consolidate contiguous parts.
Adjacent lines and linestrings become a single linestring. Adjacent and compatible arcs become single arc.
[in] | doSimplifyLinestrings | true to eliminate colinear interior points of linestrings. |
|
static |
Return a curveVector with spiral-arc-spiral transtion between two lines, subject to: ul> li>specified arcRadiius for central part li>specified spiralLength for both entry and exit.
li>the spiral-to-line tangency can float along the respective straight line parts /ul>
[in] | xyz0 | PI prior to this transition |
[in] | xyz1 | PI for this transition |
[in] | xyz2 | PI after this transition |
[in] | arcRadius | radius of arc portion |
[in] | spiralLength | length of spiral |
|
static |
Construct a spiral-arc-spiral transition that is an (approximate) offset of a primary transition.
ul> li>The offset is a constructSpiralArcSpiralTransition for a simple offset of the 3 point alignments. li>The radius differs from the primaryRadius by (exactly) offsetDistance. li>The spiral length is adjusted so that the tangency point for the line-to-spiral is exactly at the offset of the corresponding line-spiral li>specified spiralLength for both entry and exit. li>the spiral-to-line tangency can float along the respective straight line parts li>offsets at all distances maintain the spiral-arc-spiral structure. Because the true "rolling ball" offset of a spiral is not a spiral, the result is only an approximation of a true "rolling ball" offset. /ul>
[in] | primaryPoint0 | primary path PI prior to this transition |
[in] | primaryPoint1 | primary path PI for this transition |
[in] | primaryPoint2 | primary path PI after this transition |
[in] | primaryRadius | radius of primary path |
[in] | primarySpiralLength | primary path spiral length |
[in] | offsetDistance | offset distance. Positive is to the left of the primary path |
bool ContainsNonLinearPrimitive | ( | ) | const |
Return true if CurveVector has a component that is not a line or linestring.
size_t CountPrimitivesOfType | ( | ICurvePrimitive::CurvePrimitiveType | targetType | ) | const |
Count primitives of specified type.
[in] | targetType | primitive type to count. |
|
static |
Create a curve vector with given boundary type and no members.
|
static |
Create a curve vector with a single primitive and given boundary type.
|
static |
Create a BOUNDARY_TYPE_None with line segments.
|
static |
Create a single level curve vector structure with a single primitive.
[in] | child | child primitive. |
[in] | boundaryType |
|
static |
Create a (deep) curve vector structure for a complete elliptic (circular) disk.
[in] | arc | boundary ellipse |
[in] | boundaryType | is one of
|
[in] | forceXYOrientation | if true, reverse arc sweep so it acts as requested inner/outer in xy view. |
|
static |
Create a linestring or polygon from xyz data.
[in] | points | vertex coordinates points. |
[in] | boundaryType | is one of
|
[in] | forceXYOrientation | true to force outer and inner loops to have correct (CCW/CW) order. |
|
static |
Create a linestring or polygon from xyz data.
[in] | points | vertex coordinates points. |
[in] | numPoints | number of coordinates. |
[in] | boundaryType | is one of
|
[in] | forceXYOrientation | true to force outer and inner loops to have correct (CCW/CW) order. |
|
static |
Create a linestring or polygon from xyz data.
[in] | points | vertex coordinates points. |
[in] | numPoints | number of coordinates. |
[in] | boundaryType | is one of
|
[in] | forceXYOrientation | true to force outer and inner loops to have correct (CCW/CW) order. |
|
static |
Create a rectangle from xy corners.
[in] | x0 | start point x coordinate |
[in] | y0 | start point y coordinate |
[in] | x1 | opposite corner x coordinate |
[in] | y1 | opposite corner y coordinate |
[in] | z | z value for all points. |
[in] | boundaryType | is one of
|
|
static |
Return a curveVector with spiral transition between two lines, with shoulder points controlling the spiral max curvatures.
ul> li>Initial spiral starts at pointA, heading towards shoulderB with zero curvature. li>initial spiral turns towards shoulderC. li>initial spiral ends and has curvature-continuous change to a spiral unwinding to a tangency with line shoulderB to shoulderC li>straight line along shoulderB to shoulderC until li>second pair of spirals to transition to pointD with tangent to the direction from shoulderC to pointD /ul>
If pointA,shoulderB, shoulderC is degnerate (all colinear), the initial spiral pair is omitted and the intermediate line starts at pointA. If shoulderB, shoulderC,pointD is degenerate (all colinear), the final spiral pair is omitted and the intermediate line ends at pointD.
[in] | transitionType | transition type |
[in] | pointA | start point |
[in] | shoulderB | first target point |
[in] | shoulderC | second target point |
[in] | pointD | end point |
|
static |
Return a curve vector (of type BOUNDARY_TYPE_None) containing hatch sticks.
[in] | boundary | boundary curves. |
[in] | startPoint | Start point for hatch lines |
[in] | angleRadians | angle from X axis. |
[in] | spacing | spacing perpendicular to hatch direction |
selection | 0 for parity rules, 1 for longest possible strokes (first to last crossings), 2 for leftmsot and rightmost of parity set. |
int CurveLocationDetailCompare | ( | CurveLocationDetail const & | location0, |
CurveLocationDetail const & | location1 | ||
) | const |
return 0 of locations are equal, -1 if location 0 is less than location 1, and 1 if location 0 > location 1.
This is a lexical comparison using (only) the curve index and the fraction.
size_t CurveLocationDetailIndex | ( | CurveLocationDetail const & | location | ) | const |
return index of curve location detail in vector (only valid for a vector that is a single open or closed path).
Returns SIZE_MAX if not found.
size_t CyclicIndex | ( | int | index | ) | const |
return mod of index with vector length, properly corrected for negatives.
double FastLength | ( | ) | const |
Sum lengths of contained curves, using fast method that may overestimate the length but is reasonable for setting tolerances.
double FastMaxAbs | ( | ) | const |
Return a fast estimate of the maximum absoluted value in any coordinate. This will examine all curves, but is allowed to use safe approximations like bspline pole coordinates instead of exact curve calculations.
size_t FindIndexOfPrimitive | ( | ICurvePrimitiveCP | primitive | ) | const |
return index of primitive in vector (only valid for a vector that is a single open or closed path).
Returns SIZE_MAX if not found.
CurveVectorPtr FindParentOfPrimitive | ( | ICurvePrimitiveCP | primitive | ) | const |
Search the tree (below the calling instance) for the curve vector which is the immediate parent of given primitive.
void FindPrimitivesWithNearbyStartEnd | ( | bvector< CurveLocationDetail > & | data, |
DPoint3dCR | xyz, | ||
double | tolerance | ||
) | const |
Search for children whose start or end is close to a search point.
[out] | data | array recording index, fraction (0 or 1), coordinate, and distance of start or end within tolerance |
[in] | xyz | search point |
[in] | tolerance | distance tolerance |
bool FixupXYOuterInner | ( | bool | fullGeometryCheck = false | ) |
Update order, boundary type, and direction of contained loops.
Loop A is considered "inside" loop B if (a) loop A has smaller area and (b) the start point of loop A is inside loop B. A loop that is "inside" and ODD number of other loops is considered to be a "hole" (inner loop) within the containing loop that has smallest area. Any other loop is considered an outer loop.
[in] | fullGeometryCheck | if true, perform all (expensive) tests for intersections among curves. When this is enabled, the returned curve vector is typically a (possibly significantly modfied) clone of the original. |
CurveVectorPtr GenerateAllParts | ( | int | indexA, |
double | fractionA, | ||
int | indexB, | ||
double | fractionB | ||
) | const |
Return a CurveVector (BOUNDARY_TYPE_None) which is a collection of open CurveVectors that collectively contain all parts of the input For (indexA,fractionA) prededing (indexB,fractionB) the output traces the input in the forward direction and has the following possibilities (of which null ones are skipped) ul> li> BOUNDARY_TYPE_Open - (A B), (B to end), (start to A) li> BOUNDARY_TYPE_Inner or BOUNDARY_TYPE_Outer - (A B), (B to where A appears in the next period) li> BOUNDARY_TYPE_ParityRegion, BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_None – no output.
/ul> For (indexA,fractionA) prededing (indexB,fractionB) the output traces the input in the reverse direction and has the following possibilities (of which null ones are skipped) ul> li> BOUNDARY_TYPE_Open - (A backwards to B), (B backwards to start), (end backwards to A) li> BOUNDARY_TYPE_Inner or BOUNDARY_TYPE_Outer - (A backwards to B), (B backwards to where A appears in the previous period.) li> BOUNDARY_TYPE_ParityRegion, BOUNDARY_TYPE_UnionRegion, BOUNDARY_TYPE_None – no output. /ul>
bool GetAnyFrenetFrame | ( | TransformR | frame | ) | const |
Deep search for any curve primitive that has a well defined coordinate frame.
[out] | frame | coordinate frame with origin on a primitive. |
bool GetAnyFrenetFrame | ( | TransformR | frame, |
int | searchPreference | ||
) | const |
Deep search for any curve primitive that has a well defined coordinate frame.
[out] | frame | coordinate frame with origin on a primitive. |
[in] | searchPreference | pre> ul> li>0 to favor use of directions as soon as possible from the begninning. li>1 to use start point, start tangent, and end tangent and accept that "no matter what" (i.e. accept default fixups if those are parallel) li>2 to use start point, start tangent, and end tangent but default to searchPreference=0 if they are parallel. /ul> /pre> |
BoundaryType GetBoundaryType | ( | ) | const |
Return the type code indicating whether the vector is a path, outer boundary, inner boundary, or higher level grouping.
MSBsplineCurvePtr GetBsplineCurve | ( | ) | const |
Represent a curve vector that denotes an open or closed path as a single bspline curve.
ICurvePrimitivePtr GetCyclic | ( | ptrdiff_t | index | ) | const |
return child at cyclic index, propertly corrected for negatives.
bool GetRange | ( | DRange3dR | range | ) | const |
Return the xyz range of contained curves.
bool GetRange | ( | DRange3dR | range, |
TransformCR | transform | ||
) | const |
Compute range of transformed structure.
[out] | transform | transform to target coordinates |
[out] | range | range of transformed curve. |
bool GetStartEnd | ( | DPoint3dR | pointA, |
DPoint3dR | pointB | ||
) | const |
Return first/last among children.
[out] | pointA | start point |
[out] | pointB | end point |
bool GetStartEnd | ( | DPoint3dR | pointA, |
DPoint3dR | pointB, | ||
DVec3dR | unitTangentA, | ||
DVec3dR | unitTangentB | ||
) | const |
Return start and end points and the (normalized!) tangents among children.
[out] | pointA | start point |
[out] | pointB | end point |
[out] | unitTangentA | normalized tangent (forward) at pointA. |
[out] | unitTangentB | normalized tangent (forward) at pointB. |
bool GetStartPoint | ( | DPoint3dR | point | ) | const |
Return start point of the primitive (or first primitive in deep search)
[out] | point | start point. |
ICurvePrimitive::CurvePrimitiveType HasSingleCurvePrimitive | ( | ) | const |
Return true if the curve vector has a single element and that element is a primitive.
bool IsAnyRegionType | ( | ) | const |
Query: is this any closed area type (single, parity, union)
bool IsClosedPath | ( | ) | const |
Query: Is this (single) closed path?
bool IsEllipticDisk | ( | DEllipse3dR | ellipse | ) | const |
Query: Is this an outer loop with an ellipse as its only curve?
bool IsOpenPath | ( | ) | const |
Query: Is this an open path?
bool IsParityRegion | ( | ) | const |
Query: Is this a collection of loops with parity rules?
bool IsPhysicallyClosedPath | ( | ) | const |
Query: Is this a nominally open path but with matching start and end?
bool IsPlanar | ( | TransformR | localToWorld, |
TransformR | worldToLocal, | ||
DRange3dR | range | ||
) | const |
Test if the contained curves are planar.
If so, return transforms transforms and local range.
[out] | localToWorld | A coordinate frame somewhere on the curves. The curves are on the xy plane. |
[out] | worldToLocal | Inverse of localToWorld. |
[out] | range | range of the curves when worldToLocal is applied. |
bool IsPlanarWithDefaultNormal | ( | TransformR | localToWorld, |
TransformR | worldToLocal, | ||
DRange3dR | range, | ||
DVec3dCP | normal | ||
) | const |
Test if the contained curves are planar.
If so, return transforms transforms and local range.
[out] | localToWorld | A coordinate frame somewhere on the curves. The curves are on the xy plane. |
[out] | worldToLocal | Inverse of localToWorld. |
[out] | range | range of the curves when worldToLocal is applied. |
[in] | normal | optional normal to resolve ambiguous cases. If this is NULL, any perpendicular to an ambiguous line will be used. |
bool IsRectangle | ( | TransformR | localToWorld, |
TransformR | worldToLocal | ||
) | const |
Query: Is this a rectangle?
[out] | localToWorld | transform with origin at start, x and y vectors to adjacent points, z vector unit normal. (i.e. the x and y vector lengths are the side lengths) |
[out] | worldToLocal | transorm to map rectangle to 0..1 in each direction. |
bool IsSameStructure | ( | CurveVectorCR | other | ) | const |
Recursive check for structural match (tree structure and leaf type) with the other curve vector.
bool IsSameStructureAndGeometry | ( | CurveVectorCR | other, |
double | tolerance = 0.0 |
||
) | const |
Recursive check for match (tree structure.
leaf type, and geometry) with a peer.
other | peer for comparison |
tolerance | distance tolerance. (See DoubleOps::AlmostEqual ()) |
bool IsUnionRegion | ( | ) | const |
Query: is this a collection of areas with union rules?
double Length | ( | ) | const |
Sum lengths of contained curves.
double Length | ( | RotMatrixCP | worldToLocal | ) | const |
Sum lengths of contained curves with transform applied.
double MaxGapWithinPath | ( | ) | const |
Maximum gap distance between end of primitive and start of its successor within Open, outer, or Inner loop.
ICurvePrimitivePtr PlaneSection | ( | DPlane3dCR | plane, |
double | tolerance = 0.0 |
||
) | const |
Compute intersections of closed CurveVector with a plane and organize as start end pairs by parity rules.
Return as a single curve primitive (which may be child vector of multiple primitives) If there are no intersections the smart pointer is empty (IsValid () returns false)
[in] | plane | |
[in] | tolerance | for on-plane decisions. If 0, a tolerance is computed based on the coordinates in the curve. |
CurveVector::InOutClassification PointInOnOutXY | ( | DPoint3dCR | xyz | ) | const |
Test if a point is in, on, or outside when looking at xy plane.
return INOUT_Unknown if the CurveVector is not an area. (i.e. type BOUNDARY_TYPE_Outer, BOUNDARY_TYPE_Inner, BOUNDARY_TYPE_ParityRegion, or BOUNDARY_TYPE_Union
[in] | xyz | test point |
DRange1d ProjectedParameterRange | ( | DRay3dCR | ray | ) | const |
Return the range of ray parameters when contents of the CurveVector are projected to a ray.
return DRange1d with range data.
[in] | ray | test ray. |
CurveVector::InOutClassification RayPierceInOnOut | ( | DRay3dCR | ray, |
SolidLocationDetailR | hitDetail | ||
) | const |
Test for a ray hit in the curve vector's planar region.
return INOUT_Unknown if the CurveVector is not an area. (i.e. type BOUNDARY_TYPE_Outer, BOUNDARY_TYPE_Inner, BOUNDARY_TYPE_ParityRegion, or BOUNDARY_TYPE_Union
[in] | ray | ray to intersect witht the region |
[out] | hitDetail | hit point with parameters relative to the region's local coordinates. |
|
static |
Return a curve vector containing only clockwise areas.
Loops within parity regions are fixed first. Then multiple regions in a union are combined.
[in] | regionA | input areas |
double ReorderForSmallGaps | ( | ) |
Reorder curve primitives to produce small head-to-tail gaps.
reordering is applied only within boundary types None, Open, and Closed. other types are updated recursively. Return the largest gap.
double ResolveTolerance | ( | double | tolerance | ) | const |
return larger of given tolerance and default tolerance based on FastMasAbs of contents ...
bool ReverseCurvesInPlace | ( | ) |
Recursively reverse.
All leaf curves are reversed. Primitive order within path types (_Outer, _Inner, _Open) is reversed. All others (_Union, _Parity, _None) are unchanged.
void SimplifyLinestrings | ( | double | distanceTol, |
bool | eliminateOverdraw, | ||
bool | wrap | ||
) |
Inplace update to consolidate colinear interior points of linestrings.
If distance tolerance is nonpositive a tolerance will be assigned from the range.
CurveVectorPtr Stroke | ( | IFacetOptionsR | options | ) | const |
Return a "deep copy" with primitives replaced by strokes.
The tree upper levels of the tree structure are retained – i.e. the output contains corresponding tree structure ParityRegion, UnionRegion, OuterLoop, and InnerLoop ul> li>UnionRegion and ParityRegion vectors: Create a new CurveVector of the same type. Recursively create children. li>OuterLoop, InnerLoop, OpenPath: Create a new curve vector of the same type. Stroke all curve primitives into a single linestring with the child curves' AddStrokes method. /ul>
bool SwapAt | ( | size_t | index0, |
size_t | index1 | ||
) |
Swap the entries at given indices. Return false if either index is out of bounds.
void SwapContents | ( | CurveVectorR | other | ) |
Swap bvectors and type.
BentleyStatus ToBsplineCurve | ( | MSBsplineCurveR | curve | ) | const |
Represent a curve vector that denotes an open or closed path as a single bspline curve.
bool TransformInPlace | ( | TransformCR | transform | ) |
Apply a transform to all contained curves.
bool TryUVFractionToXYZ | ( | double | uFraction, |
double | vFraction, | ||
DPoint3dR | xyz, | ||
DVec3dR | dXdu, | ||
DVec3dR | dXdv | ||
) | const |
convert u,v fraction to xyz and derivatives.
This is an expensive operation. It has to call CloneInLocalCoordinates before it can multiply uv by the localToWorld transformation. To do this efficiently many times, call CloneInLocalCoordinates once and reuse the localToWorld transform.
[in] | uFraction | fractional coordinate in u direction. |
[in] | vFraction | fractional coordinate in v direction. |
[out] | xyz | point on face. |
[out] | dXdu | derivative of face point wrt uFraction. |
[out] | dXdv | derivative of face point wrt vFraction. |
bool WireCentroid | ( | double & | length, |
DPoint3dR | centroid | ||
) | const |
Return the centroid of the contained curves, considered as wires.
(Isolated points are not considered.) (Bounded area centroids are not computed. The boundary curves are used as wires.) return false if no curves are found.
[out] | length | curve length |
[out] | centroid | curve centroid |