#include <opennurbs_brep.h>
Public Member Functions | |
ON_Brep () | |
Construction. More... | |
ON_Brep (const ON_Brep &) | |
~ON_Brep () | |
int | AddEdgeCurve (ON_Curve *) |
int | AddSurface (ON_Surface *) |
int | AddTrimCurve (ON_Curve *) |
Creation Interface. More... | |
ON_AggregateComponentStatus | AggregateComponentStatus () const override |
virtual More... | |
void | Append (const ON_Brep &) |
const ON_Geometry * | BrepComponent (ON_COMPONENT_INDEX ci) const |
Get a brep component from its index. More... | |
ON_Brep * | BrepForm (ON_Brep *brep=nullptr) const override |
If possible, BrepForm() creates a brep form of the ON_Geometry. More... | |
bool | ChangeVertex (int old_vi, int new_vi, bool bClearTolerances) |
Expert user tool to move trims and edges from one vertex to another. More... | |
void | Clear_edge_user_i (int) const |
void | Clear_edge_user_i () const |
void | Clear_face_user_i () const |
void | Clear_loop_user_i () const |
void | Clear_trim_user_i () const |
void | Clear_user_i () const |
void | Clear_vertex_user_i () const |
void | ClearBoundingBox () override |
virtual ON_Geometry::ClearBoundingBox() override More... | |
unsigned int | ClearComponentStates (ON_ComponentStatus states_to_clear) const override |
virtual More... | |
unsigned int | ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const override |
virtual More... | |
bool | CloseTrimGap (ON_BrepTrim &trim0, ON_BrepTrim &trim1) |
Expert user tool to remove any gap between adjacent trims. More... | |
bool | CollapseEdge (int edge_index, bool bCloseTrimGap=true, int vertex_index=-1) |
Expert user tool to collapse a "short" edge to a vertex. The edge is removed and the topology is repaired so that everything that used to connect to the edge connects the specified vertex. More... | |
bool | CombineCoincidentEdges (ON_BrepEdge &, ON_BrepEdge &) |
Expert user function. More... | |
bool | CombineCoincidentVertices (ON_BrepVertex &, ON_BrepVertex &) |
Expert user function. More... | |
ON_BrepEdge * | CombineContiguousEdges (int edge_index0, int edge_iindex1, double angle_tolerance_radians=ON_PI/180.0) |
Expert user function. Combines contiguous edges into a single edge. The edges must share a common vertex, then angle between the edge tangents are the common vertex must be less than or equal to angle_tolerance_radians, and any associated trims must be contiguous in there respective boundaries. Parameters; edge_index0 - [in] edge_index1 - [in] angle_tolerance_radians - [in] More... | |
bool | Compact () |
Uses the CullUnused*() members to delete any unreferenced objects from arrays, reindexes as needed, and shrinks arrays to minimum required size. More... | |
ON_BrepLoop::TYPE | ComputeLoopType (const ON_BrepLoop &) const |
bool | Create (ON_Surface *&pSurface) |
Create a brep from a surface. The resulting surface has an outer boundary made from four trims. The trims are ordered so that they run along the south, east, north, and then west side of the surface's parameter space. More... | |
bool | Create (ON_NurbsSurface *&pNurbsSurface) |
bool | Create (ON_PlaneSurface *&pPlaneSurface) |
bool | Create (ON_RevSurface *&pRevSurface) |
bool | Create (ON_SumSurface *&pSumSurface) |
int | CreateMesh (const ON_MeshParameters &mp, ON_SimpleArray< ON_Mesh *> &mesh_list) const |
Calculates polygon mesh approximation of the brep and appends one mesh for each face to the mesh_list[] array. More... | |
bool | CullUnused2dCurves () |
bool | CullUnused3dCurves () |
bool | CullUnusedEdges () |
bool | CullUnusedFaces () |
bool | CullUnusedLoops () |
bool | CullUnusedSurfaces () |
bool | CullUnusedTrims () |
bool | CullUnusedVertices () |
ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const override |
virtual ON_Object::DataCRC override More... | |
void | Delete2dCurve (int c2_index) |
void | Delete3dCurve (int c3_index) |
void | DeleteEdge (ON_BrepEdge &edge, bool bDeleteEdgeVertices) |
void | DeleteFace (ON_BrepFace &face, bool bDeleteFaceEdges) |
void | DeleteLoop (ON_BrepLoop &loop, bool bDeleteLoopEdges) |
void | DeleteSurface (int s_index) |
void | DeleteTrim (ON_BrepTrim &trim, bool bDeleteTrimEdges) |
void | DeleteVertex (ON_BrepVertex &vertex) |
void | Destroy () |
construction/destruction helpers More... | |
void | DestroyMesh (ON::mesh_type mesh_type, bool bDeleteMesh=true) |
Destroy meshes used to render and analyze brep. More... | |
void | DestroyRegionTopology () |
Destroy region topology information. More... | |
void | DestroyRuntimeCache (bool bDelete=true) override |
virtual ON_Object::DestroyRuntimeCache override More... | |
int | Dimension () const override |
virtual ON_Geometry::Dimension() override More... | |
bool | DisconnectEdgeFaces (int eid) |
Expert user function. Turn an edge into a series of naked or seam edges. One for each trim at the original edge that comes from a unique face. These edges will share the 3d curve of the original edge. The original edge will still be valid and will have m_ti[0] unchanged. More... | |
void | Dump (ON_TextLog &) const override |
virtual ON_Objet::Dump() override More... | |
ON_Brep * | DuplicateFace (int face_index, bool bDuplicateMeshes) const |
Duplicate a single brep face. More... | |
ON_Brep * | DuplicateFaces (int face_count, const int *face_index, bool bDuplicateMeshes) const |
Duplicate a a subset of a brep More... | |
ON_BrepEdge * | Edge (int edge_index) const |
Get edge from edge index or component index. More... | |
ON_BrepEdge * | Edge (ON_COMPONENT_INDEX edge_index) const |
int | EdgeCurveUseCount (int c3_index, int max_count=0) const |
Determine how many brep edges reference m_C3[c3_index]. More... | |
void | EmergencyDestroy () |
call if memory pool used by b-rep members becomes invalid More... | |
bool | EvaluatePoint (const class ON_ObjRef &objref, ON_3dPoint &P) const override |
virtual ON_Geometry override More... | |
ON_Brep * | ExtractFace (int face_index) |
Extract a face from a brep. More... | |
ON_BrepFace * | Face (int face_index) const |
Get face from face index or component index. More... | |
ON_BrepFace * | Face (ON_COMPONENT_INDEX face_index) const |
bool | FaceIsSurface (int) const |
void | Flip () |
void | FlipFace (ON_BrepFace &) |
reverses orientation of a face by toggling ON_BrepFace::m_bRev More... | |
void | FlipLoop (ON_BrepLoop &) |
bool | FlipReversedSurfaces () |
Modification Interface. More... | |
bool | GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const override |
virtual ON_Geometry GetBBox override More... | |
unsigned int | GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const override |
virtual More... | |
int | GetConnectedComponents (ON_SimpleArray< ON_Brep * > &components, bool bDuplicateMeshes) const |
If this brep has two or more connected components, then duplicates of the connected components are appended to the components[] array. More... | |
int | GetMesh (ON::mesh_type mesh_type, ON_SimpleArray< const ON_Mesh * > &meshes) const |
Get cached meshes used to render and analyze brep. More... | |
bool | GetTightBoundingBox (class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const override |
virtual ON_Geometry GetTightBoundingBox override More... | |
bool | GetTrim2dEnd (int, ON_2dPoint &) const |
bool | GetTrim2dStart (int trim_index, ON_2dPoint &) const |
bool | GetTrim3dEnd (int, ON_3dPoint &) const |
bool | GetTrim3dStart (int, ON_3dPoint &) const |
bool | HasBrepForm () const override |
virtual ON_Geometry::HasBrepForm() override More... | |
bool | HasRegionTopology () const |
bool | HasSlits () const |
Check for slit trims and slit boundaries in each face. More... | |
bool | HasSlits (const ON_BrepFace &F) const |
Check for slit trims and slit boundaries in a face. More... | |
bool | HasSlits (const ON_BrepLoop &L) const |
Check for slit trims in a loop. More... | |
bool | IsDuplicate (const ON_Brep &other, double tolerance=ON_ZERO_TOLERANCE) const |
Does nothing. Will be deleted in next version. More... | |
bool | IsManifold (bool *pbIsOriented=nullptr, bool *pbHasBoundary=nullptr) const |
Test brep to see if it is an oriented manifold. More... | |
bool | IsPointInside (ON_3dPoint P, double tolerance, bool bStrictlyInside) const |
Determine if P is inside Brep. This question only makes sense when the brep is a closed manifold. This function does not not check for closed or manifold, so result is not valid in those cases. Intersects a line through P with brep, finds the intersection point Q closest to P, and looks at face normal at Q. If the point Q is on an edge or the intersection is not transverse at Q, then another line is used. More... | |
bool | IsSolid () const |
Test brep to see if it is a solid. (A "solid" is a closed oriented manifold.) More... | |
bool | IsSurface () const |
bool | IsValid (class ON_TextLog *text_log=nullptr) const override |
Tests an object to see if its data members are correctly initialized. More... | |
bool | IsValidForV2 () const |
Tests brep to see if it is valid for saving in V2 3DM archives. More... | |
bool | IsValidForV2 (const ON_BrepTrim &) const |
bool | IsValidForV2 (const ON_BrepEdge &) const |
bool | IsValidGeometry (ON_TextLog *text_log=nullptr) const |
Expert user function that tests the brep to see if its geometry information is valid. The value of brep.IsValidTopology() must be true before brep.IsValidGeometry() can be safely called. More... | |
bool | IsValidTolerancesAndFlags (ON_TextLog *text_log=nullptr) const |
Expert user function that tests the brep to see if its tolerances and flags are valid. The values of brep.IsValidTopology() and brep.IsValidGeometry() must be true before brep.IsValidTolerancesAndFlags() can be safely called. More... | |
bool | IsValidTopology (ON_TextLog *text_log=nullptr) const |
Tests the brep to see if its topology information is valid. More... | |
void | LabelConnectedComponent (int face_index, int label) const |
Set m_vertex_user.i, m_edge_user.i, m_face_user.i, m_loop_user.i, and m_trim_user.i values of faces of component including m_F[face_index] to label. Numbering starts at 1. More... | |
int | LabelConnectedComponents () const |
Set m_vertex_user.i, m_edge_user.i, m_face_user.i, m_loop_user.i, and m_trim_user.i values values to distinguish connected components. More... | |
ON_BrepLoop * | Loop (int loop_index) const |
Get loop from loop index or component index. More... | |
ON_BrepLoop * | Loop (ON_COMPONENT_INDEX loop_index) const |
ON_Curve * | Loop2dCurve (const ON_BrepLoop &loop) const |
Get a 3d curve that traces the entire loop More... | |
ON_Curve * | Loop3dCurve (const ON_BrepLoop &loop, bool bRevCurveIfFaceRevIsTrue=false) const |
Get a single 3d curve that traces the entire loop More... | |
int | Loop3dCurve (const ON_BrepLoop &loop, ON_SimpleArray< ON_Curve *> &curve_list, bool bRevCurveIfFaceRevIsTrue=false) const |
Get a list of 3d curves that trace the non-seam edge portions of an entire loop More... | |
int | LoopDirection (const ON_BrepLoop &) const |
bool | LoopIsSurfaceBoundary (int) const |
ON_NurbsCurve * | MakeTrimCurveNurb (ON_BrepTrim &T) |
Convert the 2d curve of a trim to an ON_NurbsCurve More... | |
void | MarkAggregateComponentStatusAsNotCurrent () const override |
virtual More... | |
bool | MatchTrimEnds (ON_BrepTrim &T0, ON_BrepTrim &T1) |
Match the end of a trim to the start of the next trim. More... | |
bool | MatchTrimEnds (int trim_index) |
Match the endpoints of a trim to the next and previous trim More... | |
bool | MatchTrimEnds (ON_BrepLoop &Loop) |
Match the endpoints of all trims in a loop More... | |
bool | MatchTrimEnds () |
Match the endpoints of all trims in a brep More... | |
void | MemoryRelocate () override |
Override of virtual ON_Object::MemoryRelocate. More... | |
int | MergeFaces (int fid0, int fid1) |
If fid0 != fid1 and m_F[fid0] and m_F[fid1] have the same surface (m_si is identical), and they are joined along a set of edges that do not have any other faces, then this will combine the two faces into one. More... | |
bool | MergeFaces () |
Merge all possible faces that have the same m_si More... | |
ON_BrepFace * | NewConeFace (const ON_BrepVertex &vertex, const ON_BrepEdge &edge, bool bRevEdge) |
Add a new face to the brep whose surface geometry is a ruled cone with the edge as the base and the vertex as the apex point. More... | |
ON_BrepTrim & | NewCurveOnFace (ON_BrepFace &face, ON_BrepEdge &edge, bool bRev3d=false, int c2i=-1) |
Add a new curve on face to the brep. More... | |
ON_BrepEdge & | NewEdge (int=-1) |
ON_BrepEdge & | NewEdge (ON_BrepVertex &, ON_BrepVertex &, int=-1, const ON_Interval *=nullptr, double edge_tolerance=ON_UNSET_VALUE) |
ON_BrepFace & | NewFace (int si=-1) |
Add a new face to a brep. An incomplete face is added. The caller must create and fill in the loops used by the face. More... | |
ON_BrepFace * | NewFace (const ON_Surface &surface) |
Add a new face to a brep. This creates a complete face with new vertices at the surface corners, new edges along the surface boundary, etc. The loop of the returned face has four trims that correspond to the south, east, north, and west side of the surface in that order. If you use this version of NewFace to add an exiting brep, then you are responsible for using a tool like ON_Brep::JoinEdges() to hook the new face to its neighbors. More... | |
ON_BrepFace * | NewFace (ON_Surface *pSurface, int vid[4], int eid[4], bool bRev3d[4]) |
Add a new face to brep. This version is for expert users. More... | |
ON_BrepLoop & | NewLoop (ON_BrepLoop::TYPE) |
Create a new empty boundary loop. The new loop will not be part of a face and will not include any trim curves. More... | |
ON_BrepLoop & | NewLoop (ON_BrepLoop::TYPE loop_type, ON_BrepFace &face) |
Create a new boundary loop on a face. After you get this ON_BrepLoop, you still need to create the vertices, edges, and trims that define the loop. More... | |
ON_BrepLoop * | NewOuterLoop (int face_index) |
Create a new outer boundary loop that runs along the sides of the face's surface. All the necessary trims, edges, and vertices are created and added to the brep. More... | |
ON_BrepLoop * | NewOuterLoop (int face_index, int vid[4], int eid[4], bool bRev3d[4]) |
Add a new face to brep. This version is for expert users. More... | |
bool | NewPlanarFaceLoop (int face_index, ON_BrepLoop::TYPE loop_type, ON_SimpleArray< ON_Curve *> &boundary, bool bDuplicateCurves=true) |
Add a planar trimming loop to a planar face. More... | |
ON_BrepVertex & | NewPointOnFace (ON_BrepFace &face, double s, double t) |
Adds a new point on face to the brep. More... | |
ON_BrepFace * | NewRuledFace (const ON_BrepEdge &edgeA, bool bRevEdgeA, const ON_BrepEdge &edgeB, bool bRevEdgeB) |
Add a new face to the brep whose surface geometry is a ruled surface between two edges. More... | |
ON_BrepTrim & | NewSingularTrim (const ON_BrepVertex &vertex, ON_BrepLoop &loop, ON_Surface::ISO iso, int c2i=-1) |
Add a new singular trim to the brep. More... | |
ON_BrepTrim & | NewTrim (int c2i=-1) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep. More... | |
ON_BrepTrim & | NewTrim (bool bRev3d, ON_BrepLoop &loop, int c2i=-1) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep. More... | |
ON_BrepTrim & | NewTrim (ON_BrepEdge &edge, bool bRev3d, int c2i=-1) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep. More... | |
ON_BrepTrim & | NewTrim (ON_BrepEdge &edge, bool bRev3d, ON_BrepLoop &loop, int c2i=-1) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep. More... | |
ON_BrepVertex & | NewVertex () |
ON_BrepVertex & | NewVertex (ON_3dPoint vertex_point, double vertex_tolerance=ON_UNSET_VALUE) |
int | NextEdge (int current_edge_index, int endi, int *next_endi=nullptr) const |
This is a simple tool for getting running through the edges that begin and end at a vertex. More... | |
int | NextNonsingularTrim (int) const |
int | NextTrim (int) const |
ON::object_type | ObjectType () const override |
virtual ON_Objet::ObjectType() override More... | |
ON_Brep & | operator= (const ON_Brep &) |
int | PrevEdge (int current_edge_index, int endi, int *prev_endi=nullptr) const |
This is a simple tool for getting running through the edges that begin and end at a vertex. More... | |
int | PrevNonsingularTrim (int) const |
Same as NextTrim and PrevTrim, but skips over trims with type singular. More... | |
int | PrevTrim (int) const |
Navigation Interface. More... | |
bool | Read (ON_BinaryArchive &) override |
virtual ON_Objet::Read() override More... | |
const ON_BrepRegionTopology & | RegionTopology () const |
Get region topology information: In order to keep the ON_Brep class efficient, rarely used region topology information is not maintained. If you require this information, call RegionTopology(). More... | |
bool | RemoveNesting (bool bExtractSingleSegments, bool bEdges=true, bool bTrimCurves=true) |
Removes nested polycurves from the m_C2[] and m_C3[] arrays. More... | |
bool | RemoveSlits () |
remove slit trims and slit boundaries from each face. More... | |
bool | RemoveSlits (ON_BrepFace &F) |
remove slit trims and slit boundaries from a face. More... | |
bool | RemoveSlits (ON_BrepLoop &L) |
remove slit trims from a loop. More... | |
int | RemoveWireEdges (bool bDeleteVertices=true) |
Remove edges that are not connected to a face. More... | |
int | RemoveWireVertices () |
Remove vertices that are not connected to an edge. More... | |
void | Set_user (ON_U u) const |
"Expert" Interface More... | |
unsigned int | SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const override |
virtual More... | |
unsigned int | SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const override |
virtual More... | |
bool | SetEdgeCurve (ON_BrepEdge &edge, int c3_index, const ON_Interval *sub_domain=nullptr) |
Set 3d curve geometry used by a b-rep edge. More... | |
bool | SetEdgeDomain (int, const ON_Interval &) |
virtual bool | SetEdgeTolerance (ON_BrepEdge &edge, bool bLazy=false) const |
bool | SetEdgeTolerances (bool bLazy=false) |
Set the brep's edge tolerances. More... | |
void | SetTolerancesBoxesAndFlags (bool bLazy=false, bool bSetVertexTolerances=true, bool bSetEdgeTolerances=true, bool bSetTrimTolerances=true, bool bSetTrimIsoFlags=true, bool bSetTrimTypeFlags=true, bool bSetLoopTypeFlags=true, bool bSetTrimBoxes=true) |
Set tolerances and flags in a brep More... | |
virtual bool | SetTrimBoundingBox (ON_BrepTrim &trim, bool bLazy=false) |
Set the trim parameter space bounding box (trim.m_pbox). More... | |
virtual bool | SetTrimBoundingBoxes (ON_BrepLoop &loop, bool bLazy=false) |
Set the loop parameter space bounding box (loop.m_pbox). More... | |
virtual bool | SetTrimBoundingBoxes (ON_BrepFace &face, bool bLazy=false) |
Set the loop and trim parameter space bounding boxes for every loop and trim in the face More... | |
virtual bool | SetTrimBoundingBoxes (bool bLazy=false) |
Set the loop and trim parameter space bounding boxes for every loop and trim in the brep. More... | |
bool | SetTrimCurve (ON_BrepTrim &trim, int c2_index, const ON_Interval *sub_domain=nullptr) |
Set 2d curve geometry used by a b-rep trim. More... | |
bool | SetTrimDomain (int, const ON_Interval &) |
bool | SetTrimIsoFlags () |
bool | SetTrimIsoFlags (ON_BrepFace &) |
bool | SetTrimIsoFlags (ON_BrepLoop &) |
bool | SetTrimIsoFlags (ON_BrepTrim &) |
virtual bool | SetTrimTolerance (ON_BrepTrim &trim, bool bLazy=false) const |
bool | SetTrimTolerances (bool bLazy=false) |
Set the brep's trim tolerances. More... | |
bool | SetTrimTypeFlags (bool bLazy=false) |
bool | SetTrimTypeFlags (ON_BrepFace &, bool bLazy=false) |
bool | SetTrimTypeFlags (ON_BrepLoop &, bool bLazy=false) |
bool | SetTrimTypeFlags (ON_BrepTrim &, bool bLazy=false) |
bool | SetVertexTolerance (ON_BrepVertex &vertex, bool bLazy=false) const |
bool | SetVertexTolerances (bool bLazy=false) |
Set the brep's vertex tolerances. More... | |
void | SetVertices (void) |
bool | ShrinkSurface (ON_BrepFace &face, int DisableSide=0) |
Sometimes the ON_Surface used by a face extends far beyond the face's outer boundary. ShrinkSurface uses ON_Surface::Trim to remove portions of the surface that extend beyond the face's outer boundary loop. More... | |
bool | ShrinkSurfaces () |
Sometimes the ON_Surface used by a face extends far beyond the face's outer boundary. ShrinkSurfaces calls ON_Shrink::ShrinkSurface on each face to remove portions of surfaces that extend beyond their face's outer boundary loop. More... | |
unsigned int | SizeOf () const override |
virtual ON_Object::SizeOf override More... | |
virtual int | SolidOrientation () const |
Determine orientation of a brep. More... | |
bool | SortFaceLoops (ON_BrepFace &face) const |
Sort the face.m_li[] array by loop type (outer, inner, slit, crvonsrf, ptonsrf) More... | |
void | Standardize () |
Standardize all trims, edges, and faces in the brep. More... | |
bool | StandardizeEdgeCurve (int edge_index, bool bAdjustEnds) |
Standardizes the relationship between an ON_BrepEdge and the 3d curve it uses. When done, the edge will be the only edge that references its 3d curve, the domains of the edge and 3d curve will be the same, and the edge will use the entire locus of the 3d curve. More... | |
bool | StandardizeEdgeCurve (int edge_index, bool bAdjustEnds, int EdgeCurveUse) |
Expert user only. Same as above, but to be used when the edge curve use count is known for the edge. Standardizes the relationship between an ON_BrepEdge and the 3d curve it uses. When done, the edge will be the only edge that references its 3d curve, the domains of the edge and 3d curve will be the same, and the edge will use the entire locus of the 3d curve. More... | |
void | StandardizeEdgeCurves (bool bAdjustEnds) |
Standardize all edges in the brep. More... | |
bool | StandardizeFaceSurface (int face_index) |
Standardizes the relationship between an ON_BrepFace and the 3d surface it uses. When done, the face will be the only face that references its 3d surface, and the orientations of the face and 3d surface will be the same. More... | |
void | StandardizeFaceSurfaces () |
Standardize all faces in the brep. More... | |
bool | StandardizeTrimCurve (int trim_index) |
Standardizes the relationship between an ON_BrepTrim and the 2d curve it uses. When done, the trim will be the only trim that references its 2d curve, the domains of the trim and 2d curve will be the same, and the trim will use the entire locus of the 2d curve. More... | |
void | StandardizeTrimCurves () |
Standardize all trims in the brep. More... | |
ON_Brep * | SubBrep (int subfi_count, const int *sub_fi, ON_Brep *sub_brep=0) const |
Copy a subset of this brep. More... | |
int | SurfaceUseCount (int surface_index, int max_count=0) const |
Query Interface. More... | |
bool | SwapCoordinates (int, int) override |
virtual ON_Geometry::SwapCoordinates() override More... | |
bool | Transform (const ON_Xform &) override |
virtual ON_Geometry::Transform() override More... | |
ON_BrepTrim * | Trim (int trim_index) const |
Get trim from trim index or component index. More... | |
ON_BrepTrim * | Trim (ON_COMPONENT_INDEX trim_index) const |
int | TrimCurveUseCount (int c2_index, int max_count=0) const |
Determine how many brep trims reference m_C2[c2_index]. More... | |
ON_BrepTrim::TYPE | TrimType (const ON_BrepTrim &trim, bool bLazy=true) const |
Calculate the type (singular, mated, boundary, etc.) of an ON_BrepTrim object. More... | |
ON_BrepVertex * | Vertex (int vertex_index) const |
Get vertex from trim index or component index. More... | |
ON_BrepVertex * | Vertex (ON_COMPONENT_INDEX vertex_index) const |
bool | Write (ON_BinaryArchive &) const override |
virtual ON_Objet::Write() override More... | |
Public Member Functions inherited from ON_Geometry | |
ON_Geometry ()=default | |
ON_Geometry (const ON_Geometry &)=default | |
~ON_Geometry ()=default | |
ON_BoundingBox | BoundingBox () const |
Get object's 3d axis aligned bounding box. More... | |
virtual ON_COMPONENT_INDEX | ComponentIndex () const |
If this piece of geometry is a component in something larger, like an ON_BrepEdge in an ON_Brep, then this function returns the component index. More... | |
bool | GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const |
Get object's 3d axis aligned bounding box or the union of the input box with the object's bounding box. More... | |
bool | GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const |
Get corners of object's 3d axis aligned bounding box or the union of the input box with the object's bounding box. More... | |
virtual bool | IsDeformable () const |
bool | IsValid (class ON_TextLog *text_log=nullptr) const override |
Tests an object to see if its data members are correctly initialized. More... | |
virtual bool | MakeDeformable () |
If possible, converts the object into a form that can be accuratly modified with "squishy" transformations like projections, shears, an non-uniform scaling. More... | |
ON_Geometry & | operator= (const ON_Geometry &)=default |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). More... | |
bool | Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule). More... | |
bool | Scale (double scale_factor) |
Scales the object by the specified facotor. The scale is centered at the origin. More... | |
bool | Translate (const ON_3dVector &translation_vector) |
Translates the object along the specified vector. More... | |
Public Member Functions inherited from ON_Object | |
ON_Object () ON_NOEXCEPT | |
ON_Object (const ON_Object &) | |
virtual | ~ON_Object () |
bool | AttachUserData (class ON_UserData *pUserData) |
Attach user data to an object. More... | |
unsigned int | ClearAllComponentStates () const |
Set all active level component states to ON_ComponentStatus::NoneSet. More... | |
unsigned int | CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution) |
Expert user tool that copies user data items with positive values of ON_UserData.m_userdata_copycount from source_object to "this. More... | |
void | CopyUserData (const ON_Object &source_object) |
Calls CopyUserData(source_object,ON_Object::UserDataConflictResolution::source_object). More... | |
virtual bool | DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count) |
Delete the portions of the object identified in ci_list[]. More... | |
bool | DetachUserData (class ON_UserData *pUserData) |
Remove user data from an object. More... | |
void | EmergencyDestroy () |
Sets m_user_data_list = 0. More... | |
class ON_UserData * | FirstUserData () const |
User data is stored as a linked list of ON_UserData classes. FirstUserData gets the first item in the linked list. This is the most recent item attached using AttachUserData(). Remark: To iterate through all the user data on an object, call FirstUserData() and then use ON_UserData::Next() to traverse the list. More... | |
class ON_UserData * | GetUserData (const ON_UUID &userdata_uuid) const |
Get a pointer to user data. More... | |
bool | GetUserString (const wchar_t *key, ON_wString &string_value) const |
Get user string from the object. More... | |
int | GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const |
Get a list of all user string keys on the object. More... | |
int | GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const |
Get a list of all user strings on the object. More... | |
bool | IsKindOf (const ON_ClassId *pClassId) const |
Low level tool to test if an object is derived from a specified class. More... | |
virtual ON_UUID | ModelObjectId () const |
All objects in an opennurbs model have an id ( ON_Layer.m_layer_id, ON_Font.m_font_id, ON_Material.m_material_id, ON_3dmObjectAttributes.m_uuid ). More... | |
unsigned int | MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems) |
Expert user tool that moves user data items from source_object to "this. More... | |
void | MoveUserData (ON_Object &source_object) |
Calls MoveUserData(source_object,ON_Object::UserDataConflictResolution::source_object,true). More... | |
ON_Object & | operator= (const ON_Object &) |
void | PurgeUserData () |
PurgeUserData() removes all user data from object. More... | |
bool | SetUserString (const wchar_t *key, const wchar_t *string_value) |
Attach a user string to the object. This information will perisist through copy construction, operator=, and file IO. More... | |
int | SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace) |
Append entries to the user string list More... | |
void | TransformUserData (const class ON_Xform &xform) |
Objects derived from ON_Geometry must call TransformUserData() in their Transform() member function. More... | |
virtual bool | UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map) |
Uses the destination_manifest to update references to other components. This is typically done when a component's references came from a "source" context and are being updated to the "destination" context. For example, inserting one model into another when index, id, and name conflicts need to be resolved at the time of insertion. More... | |
int | UserStringCount () const |
Static Public Member Functions | |
static ON_Brep * | New () |
Use ON_Brep::New() instead of new ON_Brep() when writing Rhino plug-ins (or when openNURBS is used as a Microsoft DLL and you need to create a new ON_Brep in a different .EXE or .DLL). More... | |
static ON_Brep * | New (const ON_Brep &) |
Use ON_Brep::New(const ON_Brep& src) instead of new ON_Brep(const ON_Brep& src). More... | |
Public Attributes | |
ON_U | m_brep_user |
ON_CurveArray | m_C2 |
ON_CurveArray | m_C3 |
ON_BrepEdgeArray | m_E |
ON_BrepFaceArray | m_F |
ON_BrepLoopArray | m_L |
ON_SurfaceArray | m_S |
ON_BrepTrimArray | m_T |
ON_BrepVertexArray | m_V |
Protected Member Functions | |
void | ClearEdgeVertices () |
void | ClearTrimVertices () |
bool | HopAcrossEdge (int &, int &) const |
void | Initialize () |
void | Internal_AttachV5RegionTopologyAsUserData (ON_BinaryArchive &archive) const |
bool | IsValidEdge (int edge_index, ON_TextLog *text_log) const |
bool | IsValidEdgeGeometry (int edge_index, ON_TextLog *text_log) const |
bool | IsValidEdgeTolerancesAndFlags (int edge_index, ON_TextLog *text_log) const |
bool | IsValidEdgeTopology (int edge_index, ON_TextLog *text_log) const |
bool | IsValidFace (int face_index, ON_TextLog *text_log) const |
bool | IsValidFaceGeometry (int face_index, ON_TextLog *text_log) const |
bool | IsValidFaceTolerancesAndFlags (int face_index, ON_TextLog *text_log) const |
bool | IsValidFaceTopology (int face_index, ON_TextLog *text_log) const |
bool | IsValidLoop (int loop_index, ON_TextLog *text_log) const |
bool | IsValidLoopGeometry (int loop_index, ON_TextLog *text_log) const |
bool | IsValidLoopTolerancesAndFlags (int loop_index, ON_TextLog *text_log) const |
bool | IsValidLoopTopology (int loop_index, ON_TextLog *text_log) const |
bool | IsValidTrim (int trim_index, ON_TextLog *text_log) const |
helpers for validation checking More... | |
bool | IsValidTrimGeometry (int trim_index, ON_TextLog *text_log) const |
bool | IsValidTrimTolerancesAndFlags (int trim_index, ON_TextLog *text_log) const |
bool | IsValidTrimTopology (int trim_index, ON_TextLog *text_log) const |
bool | IsValidVertex (int vertex_index, ON_TextLog *text_log) const |
bool | IsValidVertexGeometry (int vertex_index, ON_TextLog *text_log) const |
bool | IsValidVertexTolerancesAndFlags (int vertex_index, ON_TextLog *text_log) const |
bool | IsValidVertexTopology (int vertex_index, ON_TextLog *text_log) const |
ON_Curve * | Read100_BrepCurve (ON_BinaryArchive &) const |
ON_Surface * | Read100_BrepSurface (ON_BinaryArchive &) const |
bool | ReadOld100 (ON_BinaryArchive &) |
read helpers to support various versions More... | |
bool | ReadOld101 (ON_BinaryArchive &) |
bool | ReadOld200 (ON_BinaryArchive &, int) |
bool | ReadV1_LegacyFaceStuff (ON_BinaryArchive &) |
bool | ReadV1_LegacyLoop (ON_BinaryArchive &, ON_BrepFace &) |
bool | ReadV1_LegacyLoopStuff (ON_BinaryArchive &, ON_BrepFace &) |
bool | ReadV1_LegacyShellStuff (ON_BinaryArchive &) |
bool | ReadV1_LegacyTrim (ON_BinaryArchive &, ON_BrepFace &, ON_BrepLoop &) |
bool | ReadV1_LegacyTrimStuff (ON_BinaryArchive &, ON_BrepFace &, ON_BrepLoop &) |
helpers for reading legacy v1 trimmed surfaces and breps More... | |
bool | SetEdgeVertex (const int, const int, const int) |
helpers to create and set vertices More... | |
void | SetLoopVertices (const int) |
void | SetTolsFromLegacyValues () |
void | SetTrimIsoFlag (int, double[6]) |
helpers to set ON_BrepTrim::m_iso flag More... | |
void | SetTrimIsoFlag (int) |
bool | SetTrimStartVertex (const int, const int) |
bool | SwapLoopParameters (int) |
helpers for SwapFaceParameters() More... | |
bool | SwapTrimParameters (int) |
Static Protected Member Functions | |
static class ON_BrepRegionTopology * | Internal_RegionTopologyPointer (const ON_Brep *brep, bool bValidateFaceCount) |
Protected Attributes | |
ON_AggregateComponentStatus | m_aggregate_status |
ON_BoundingBox | m_bbox |
int | m_is_solid = 0 |
class ON_BrepRegionTopology * | m_region_topology = nullptr |
Friends | |
bool | ON_BinaryArchive::ReadV1_TCODE_LEGACY_FAC (ON_Object **, ON_3dmObjectAttributes *) |
bool | ON_BinaryArchive::ReadV1_TCODE_LEGACY_SHL (ON_Object **, ON_3dmObjectAttributes *) |
class | ON_BrepFace |
class | ON_BrepFaceSide |
class | ON_BrepRegion |
class | ON_V5_BrepRegionTopologyUserData |
Additional Inherited Members | |
Public Types inherited from ON_Object | |
enum | UserDataConflictResolution : unsigned char { UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3, UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6 } |
When a userdata item is copied or moved from a source object to a destination object, the ON_Object::UserDataConflictResolution enum values specify how conficts are resolved. Remark: A userdata item "conflict" occurs when both the destination and source object have a user data item with the same value of ON_UserData::m_userdata_uuid. More... | |
Static Public Attributes inherited from ON_Geometry | |
static const ON_Geometry | Unset |
ON_Brep::ON_Brep | ( | ) |
Construction.
ON_Brep::~ON_Brep | ( | ) |
ON_Brep::ON_Brep | ( | const ON_Brep & | ) |
int ON_Brep::AddEdgeCurve | ( | ON_Curve * | ) |
int ON_Brep::AddSurface | ( | ON_Surface * | ) |
int ON_Brep::AddTrimCurve | ( | ON_Curve * | ) |
Creation Interface.
|
overridevirtual |
virtual
Reimplemented from ON_Object.
void ON_Brep::Append | ( | const ON_Brep & | ) |
const ON_Geometry* ON_Brep::BrepComponent | ( | ON_COMPONENT_INDEX | ci | ) | const |
Get a brep component from its index.
component_index | [in] |
If possible, BrepForm() creates a brep form of the ON_Geometry.
brep | [in] if not nullptr, brep is used to store the brep form of the geometry. Result: If brep is not nullptr, then brep = this, otherwise a duplicate of this is returned. |
Override of virtual ON_Geometry::BrepForm
Reimplemented from ON_Geometry.
bool ON_Brep::ChangeVertex | ( | int | old_vi, |
int | new_vi, | ||
bool | bClearTolerances | ||
) |
Expert user tool to move trims and edges from one vertex to another.
old_vi | [in] index of old vertex |
new_vi | [in] index of new vertex |
bClearTolerances | [in] if true, then tolerances of edges and trims that are connected ot the old vertex are set to ON_UNSET_VALUE. |
vertex_index | [in] if >= 0, this the edge is collapsed to this vertex. Otherwise a vertex is automatically selected or created. |
After you finish cleaning up the brep, you need to call ON_Brep::Compact() to remove unused edge, trim, and vertex information from the brep's m_E[], m_V[], m_T[], m_C2[], and m_C3[] arrays.
void ON_Brep::Clear_edge_user_i | ( | int | ) | const |
void ON_Brep::Clear_edge_user_i | ( | ) | const |
void ON_Brep::Clear_face_user_i | ( | ) | const |
void ON_Brep::Clear_loop_user_i | ( | ) | const |
void ON_Brep::Clear_trim_user_i | ( | ) | const |
void ON_Brep::Clear_user_i | ( | ) | const |
void ON_Brep::Clear_vertex_user_i | ( | ) | const |
|
overridevirtual |
virtual ON_Geometry::ClearBoundingBox() override
Reimplemented from ON_Geometry.
|
overridevirtual |
virtual
Reimplemented from ON_Object.
|
overridevirtual |
virtual
Reimplemented from ON_Object.
|
protected |
|
protected |
bool ON_Brep::CloseTrimGap | ( | ON_BrepTrim & | trim0, |
ON_BrepTrim & | trim1 | ||
) |
Expert user tool to remove any gap between adjacent trims.
trim0 | [in] |
trim1 | [in] |
The trims must be in the same trimming loop. The vertex at the end of trim0 must be the same as the vertex at the start of trim1. The trim's m_iso and m_type flags need to be correctly set.
bool ON_Brep::CollapseEdge | ( | int | edge_index, |
bool | bCloseTrimGap = true , |
||
int | vertex_index = -1 |
||
) |
Expert user tool to collapse a "short" edge to a vertex. The edge is removed and the topology is repaired so that everything that used to connect to the edge connects the specified vertex.
edge_index | [in] index of edge to remove |
bCloseTrimGap | [in] if true and the removal of the edge creates a gap in the parameter space trimming loop, then the 2d trim curves will be adjusted to close the gap. |
vertex_index | [in] if >= 0, this the edge is collapsed to this vertex. Otherwise a vertex is automatically selected or created. |
After you finish cleaning up the brep, you need to call ON_Brep::Compact() to remove unused edge, trim, and vertex information from the brep's m_E[], m_V[], m_T[], m_C2[], and m_C3[] arrays.
bool ON_Brep::CombineCoincidentEdges | ( | ON_BrepEdge & | , |
ON_BrepEdge & | |||
) |
Expert user function.
bool ON_Brep::CombineCoincidentVertices | ( | ON_BrepVertex & | , |
ON_BrepVertex & | |||
) |
Expert user function.
ON_BrepEdge* ON_Brep::CombineContiguousEdges | ( | int | edge_index0, |
int | edge_iindex1, | ||
double | angle_tolerance_radians = ON_PI/180.0 |
||
) |
Expert user function. Combines contiguous edges into a single edge. The edges must share a common vertex, then angle between the edge tangents are the common vertex must be less than or equal to angle_tolerance_radians, and any associated trims must be contiguous in there respective boundaries. Parameters; edge_index0 - [in] edge_index1 - [in] angle_tolerance_radians - [in]
The input edges are deleted but are still in the brep's m_E[] arrays. Use ON_Brep::Compact to remove the unused edges.
bool ON_Brep::Compact | ( | ) |
Uses the CullUnused*() members to delete any unreferenced objects from arrays, reindexes as needed, and shrinks arrays to minimum required size.
ON_BrepLoop::TYPE ON_Brep::ComputeLoopType | ( | const ON_BrepLoop & | ) | const |
bool ON_Brep::Create | ( | ON_Surface *& | pSurface | ) |
Create a brep from a surface. The resulting surface has an outer boundary made from four trims. The trims are ordered so that they run along the south, east, north, and then west side of the surface's parameter space.
pSurface | [in] pointer to a surface. The brep will manage this pointer and delete it in ~ON_Brep. |
The surface class must be created with new so that the delete in ~ON_Brep will not cause a crash.
bool ON_Brep::Create | ( | ON_NurbsSurface *& | pNurbsSurface | ) |
bool ON_Brep::Create | ( | ON_PlaneSurface *& | pPlaneSurface | ) |
bool ON_Brep::Create | ( | ON_RevSurface *& | pRevSurface | ) |
bool ON_Brep::Create | ( | ON_SumSurface *& | pSumSurface | ) |
int ON_Brep::CreateMesh | ( | const ON_MeshParameters & | mp, |
ON_SimpleArray< ON_Mesh *> & | mesh_list | ||
) | const |
Calculates polygon mesh approximation of the brep and appends one mesh for each face to the mesh_list[] array.
mp | [in] meshing parameters |
mesh_list | [out] meshes are appended to this array. |
bool ON_Brep::CullUnused2dCurves | ( | ) |
bool ON_Brep::CullUnused3dCurves | ( | ) |
bool ON_Brep::CullUnusedEdges | ( | ) |
bool ON_Brep::CullUnusedFaces | ( | ) |
bool ON_Brep::CullUnusedLoops | ( | ) |
bool ON_Brep::CullUnusedSurfaces | ( | ) |
bool ON_Brep::CullUnusedTrims | ( | ) |
bool ON_Brep::CullUnusedVertices | ( | ) |
|
overridevirtual |
virtual ON_Object::DataCRC override
Reimplemented from ON_Object.
void ON_Brep::Delete2dCurve | ( | int | c2_index | ) |
void ON_Brep::Delete3dCurve | ( | int | c3_index | ) |
void ON_Brep::DeleteEdge | ( | ON_BrepEdge & | edge, |
bool | bDeleteEdgeVertices | ||
) |
void ON_Brep::DeleteFace | ( | ON_BrepFace & | face, |
bool | bDeleteFaceEdges | ||
) |
void ON_Brep::DeleteLoop | ( | ON_BrepLoop & | loop, |
bool | bDeleteLoopEdges | ||
) |
void ON_Brep::DeleteSurface | ( | int | s_index | ) |
void ON_Brep::DeleteTrim | ( | ON_BrepTrim & | trim, |
bool | bDeleteTrimEdges | ||
) |
void ON_Brep::DeleteVertex | ( | ON_BrepVertex & | vertex | ) |
void ON_Brep::Destroy | ( | ) |
construction/destruction helpers
returns Brep to state it has after default construction
void ON_Brep::DestroyMesh | ( | ON::mesh_type | mesh_type, |
bool | bDeleteMesh = true |
||
) |
Destroy meshes used to render and analyze brep.
mesh_type | [in] type of mesh to destroy |
bDeleteMesh | [in] if true, cached meshes are deleted. If false, pointers to cached meshes are just set to nullptr. |
void ON_Brep::DestroyRegionTopology | ( | ) |
Destroy region topology information.
|
overridevirtual |
virtual ON_Object::DestroyRuntimeCache override
Reimplemented from ON_Object.
|
overridevirtual |
virtual ON_Geometry::Dimension() override
Reimplemented from ON_Geometry.
bool ON_Brep::DisconnectEdgeFaces | ( | int | eid | ) |
Expert user function. Turn an edge into a series of naked or seam edges. One for each trim at the original edge that comes from a unique face. These edges will share the 3d curve of the original edge. The original edge will still be valid and will have m_ti[0] unchanged.
|
overridevirtual |
virtual ON_Objet::Dump() override
Reimplemented from ON_Object.
ON_Brep* ON_Brep::DuplicateFace | ( | int | face_index, |
bool | bDuplicateMeshes | ||
) | const |
Duplicate a single brep face.
face_index | [in] index of face to duplicate |
bDuplicateMeshes | [in] if true, any attached meshes are duplicated |
The m_vertex_user.i, m_edge_user.i, m_face_user.i, m_loop_user.i, and m_trim_user.i values of the returned brep are are set to the indices of the objects they duplicate.
ON_Brep* ON_Brep::DuplicateFaces | ( | int | face_count, |
const int * | face_index, | ||
bool | bDuplicateMeshes | ||
) | const |
Duplicate a a subset of a brep
face_count | [in] length of face_index[] array |
face_index | [in] array of face indices |
bDuplicateMeshes | [in] if true, any attached meshes are duplicated |
The m_vertex_user.i, m_edge_user.i, m_face_user.i, m_loop_user.i, and m_trim_user.i values of the returned brep are are set to the indices of the objects they duplicate.
ON_BrepEdge* ON_Brep::Edge | ( | int | edge_index | ) | const |
Get edge from edge index or component index.
edge_index | [in] either an index into m_E[] or a component index of type brep_edge. |
ON_BrepEdge* ON_Brep::Edge | ( | ON_COMPONENT_INDEX | edge_index | ) | const |
int ON_Brep::EdgeCurveUseCount | ( | int | c3_index, |
int | max_count = 0 |
||
) | const |
Determine how many brep edges reference m_C3[c3_index].
c3_index | [in] index of the 3d curve in m_C3[] array |
max_count | [in] counting stops if max_count > 0 and at least max_count edges use the 3d curve. |
void ON_Brep::EmergencyDestroy | ( | ) |
call if memory pool used by b-rep members becomes invalid
|
overridevirtual |
virtual ON_Geometry override
Reimplemented from ON_Geometry.
ON_Brep* ON_Brep::ExtractFace | ( | int | face_index | ) |
Extract a face from a brep.
face_index | [in] index of face to extract |
ON_BrepFace* ON_Brep::Face | ( | int | face_index | ) | const |
Get face from face index or component index.
face_index | [in] either an index into m_F[] or a component index of type brep_face. |
ON_BrepFace* ON_Brep::Face | ( | ON_COMPONENT_INDEX | face_index | ) | const |
bool ON_Brep::FaceIsSurface | ( | int | ) | const |
void ON_Brep::Flip | ( | ) |
void ON_Brep::FlipFace | ( | ON_BrepFace & | ) |
reverses orientation of a face by toggling ON_BrepFace::m_bRev
void ON_Brep::FlipLoop | ( | ON_BrepLoop & | ) |
bool ON_Brep::FlipReversedSurfaces | ( | ) |
Modification Interface.
|
overridevirtual |
virtual ON_Geometry GetBBox override
Reimplemented from ON_Geometry.
|
overridevirtual |
virtual
Reimplemented from ON_Object.
int ON_Brep::GetConnectedComponents | ( | ON_SimpleArray< ON_Brep * > & | components, |
bool | bDuplicateMeshes | ||
) | const |
If this brep has two or more connected components, then duplicates of the connected components are appended to the components[] array.
components | [in] connected components are appended to this array. |
bDuplicateMeshes | [in] if true, any meshes on this brep are copied to the output breps. |
int ON_Brep::GetMesh | ( | ON::mesh_type | mesh_type, |
ON_SimpleArray< const ON_Mesh * > & | meshes | ||
) | const |
Get cached meshes used to render and analyze brep.
mesh_type | [in] type of mesh to get |
meshes | [out] meshes are appended to this array. The ON_Brep owns these meshes so they cannot be modified. |
|
overridevirtual |
virtual ON_Geometry GetTightBoundingBox override
Reimplemented from ON_Geometry.
bool ON_Brep::GetTrim2dEnd | ( | int | , |
ON_2dPoint & | |||
) | const |
bool ON_Brep::GetTrim2dStart | ( | int | trim_index, |
ON_2dPoint & | |||
) | const |
bool ON_Brep::GetTrim3dEnd | ( | int | , |
ON_3dPoint & | |||
) | const |
bool ON_Brep::GetTrim3dStart | ( | int | , |
ON_3dPoint & | |||
) | const |
|
overridevirtual |
virtual ON_Geometry::HasBrepForm() override
Reimplemented from ON_Geometry.
bool ON_Brep::HasRegionTopology | ( | ) | const |
bool ON_Brep::HasSlits | ( | ) | const |
Check for slit trims and slit boundaries in each face.
bool ON_Brep::HasSlits | ( | const ON_BrepFace & | F | ) | const |
Check for slit trims and slit boundaries in a face.
bool ON_Brep::HasSlits | ( | const ON_BrepLoop & | L | ) | const |
Check for slit trims in a loop.
|
protected |
|
protected |
|
protected |
|
staticprotected |
bool ON_Brep::IsDuplicate | ( | const ON_Brep & | other, |
double | tolerance = ON_ZERO_TOLERANCE |
||
) | const |
Does nothing. Will be deleted in next version.
bool ON_Brep::IsManifold | ( | bool * | pbIsOriented = nullptr , |
bool * | pbHasBoundary = nullptr |
||
) | const |
Test brep to see if it is an oriented manifold.
pbIsOriented | [in] if not null, *pbIsOriented is set to true if b-rep is an oriented manifold and false if brep is not an oriented manifold. |
pbHasBoundary | [in] if not null, *pbHasBoundary is set to true if b-rep has a boundary edge and false if brep does not have a boundary edge. |
bool ON_Brep::IsPointInside | ( | ON_3dPoint | P, |
double | tolerance, | ||
bool | bStrictlyInside | ||
) | const |
Determine if P is inside Brep. This question only makes sense when the brep is a closed manifold. This function does not not check for closed or manifold, so result is not valid in those cases. Intersects a line through P with brep, finds the intersection point Q closest to P, and looks at face normal at Q. If the point Q is on an edge or the intersection is not transverse at Q, then another line is used.
P | [in] 3d point |
tolerance | [in] 3d distance tolerance used for intersection and determining strict inclusion. |
bStrictlInside | [in] If bStrictlInside is true, then this function will return false if the distance from P is within tolerance of a brep face. |
bool ON_Brep::IsSolid | ( | ) | const |
Test brep to see if it is a solid. (A "solid" is a closed oriented manifold.)
bool ON_Brep::IsSurface | ( | ) | const |
|
overridevirtual |
Tests an object to see if its data members are correctly initialized.
text_log | [in] if the object is not valid and text_log is not nullptr, then a brief englis description of the reason the object is not valid is appened to the log. The information appended to text_log is suitable for |
low | level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. |
Reimplemented from ON_Object.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool ON_Brep::IsValidForV2 | ( | ) | const |
Tests brep to see if it is valid for saving in V2 3DM archives.
V2 breps could not have dangling curves.
bool ON_Brep::IsValidForV2 | ( | const ON_BrepTrim & | ) | const |
bool ON_Brep::IsValidForV2 | ( | const ON_BrepEdge & | ) | const |
bool ON_Brep::IsValidGeometry | ( | ON_TextLog * | text_log = nullptr | ) | const |
Expert user function that tests the brep to see if its geometry information is valid. The value of brep.IsValidTopology() must be true before brep.IsValidGeometry() can be safely called.
text_log | [in] if the brep geometry is not valid and text_log is not nullptr, then a brief english description of the problem is appended to the log. The information appended to text_log is suitable for |
low | level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. |
ON_Brep::IsValidTopology must be true before you can safely call ON_Brep::IsValidGeometry.
|
protected |
|
protected |
|
protected |
|
protected |
bool ON_Brep::IsValidTolerancesAndFlags | ( | ON_TextLog * | text_log = nullptr | ) | const |
Expert user function that tests the brep to see if its tolerances and flags are valid. The values of brep.IsValidTopology() and brep.IsValidGeometry() must be true before brep.IsValidTolerancesAndFlags() can be safely called.
text_log | [in] if the brep tolerance or flags are not valid and text_log is not nullptr, then a brief english description of the problem is appended to the log. The information appended to text_log is suitable for |
low | level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. |
ON_Brep::IsValidTopology and ON_Brep::IsValidGeometry must be true before you can safely call ON_Brep::IsValidTolerancesAndFlags.
bool ON_Brep::IsValidTopology | ( | ON_TextLog * | text_log = nullptr | ) | const |
Tests the brep to see if its topology information is valid.
text_log | [in] if the brep topology is not valid and text_log is not nullptr, then a brief english description of the problem is appended to the log. The information appended to text_log is suitable for |
low | level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. |
ON_Brep::IsValidTopology can be called at any time.
|
protected |
helpers for validation checking
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void ON_Brep::LabelConnectedComponent | ( | int | face_index, |
int | label | ||
) | const |
Set m_vertex_user.i, m_edge_user.i, m_face_user.i, m_loop_user.i, and m_trim_user.i values of faces of component including m_F[face_index] to label. Numbering starts at 1.
face_index | [in] index of face in component |
label | [in] value for m_*_user.i |
Chases through trim lists of face edges to find adjacent faces. Does NOT check for vertex-vertex connections
int ON_Brep::LabelConnectedComponents | ( | ) | const |
Set m_vertex_user.i, m_edge_user.i, m_face_user.i, m_loop_user.i, and m_trim_user.i values values to distinguish connected components.
For each face in the ith component, sets m_face_user.i to i>0. Chases through trim lists of face edges to find adjacent faces. Numbering starts at 1. Does NOT check for vertex-vertex connections.
ON_BrepLoop* ON_Brep::Loop | ( | int | loop_index | ) | const |
Get loop from loop index or component index.
loop_index | [in] either an index into m_L[] or a component index of type brep_loop. |
ON_BrepLoop* ON_Brep::Loop | ( | ON_COMPONENT_INDEX | loop_index | ) | const |
ON_Curve* ON_Brep::Loop2dCurve | ( | const ON_BrepLoop & | loop | ) | const |
Get a 3d curve that traces the entire loop
loop | [in] loop whose 2d curve should be duplicated |
ON_Curve* ON_Brep::Loop3dCurve | ( | const ON_BrepLoop & | loop, |
bool | bRevCurveIfFaceRevIsTrue = false |
||
) | const |
Get a single 3d curve that traces the entire loop
loop | [in] loop whose 3d curve should be duplicated |
bRevCurveIfFaceRevIsTrue | [in] If false, the returned 3d curve has an orientation compatible with the 2d curve returned by Loop2dCurve(). If true and the m_bRev flag of the loop's face is true, then the returned curve is reversed. |
int ON_Brep::Loop3dCurve | ( | const ON_BrepLoop & | loop, |
ON_SimpleArray< ON_Curve *> & | curve_list, | ||
bool | bRevCurveIfFaceRevIsTrue = false |
||
) | const |
Get a list of 3d curves that trace the non-seam edge portions of an entire loop
loop | [in] loop whose 3d curve should be duplicated |
curve_list | [out] 3d curves are appended to this list |
bRevCurveIfFaceRevIsTrue | [in] If false, the returned 3d curves have an orientation compatible with the 2d curve returned by Loop2dCurve(). If true and the m_bRev flag of the loop's face is true, then the returned curves are reversed. |
int ON_Brep::LoopDirection | ( | const ON_BrepLoop & | ) | const |
bool ON_Brep::LoopIsSurfaceBoundary | ( | int | ) | const |
ON_NurbsCurve* ON_Brep::MakeTrimCurveNurb | ( | ON_BrepTrim & | T | ) |
Convert the 2d curve of a trim to an ON_NurbsCurve
T | [in] brep trim |
|
overridevirtual |
virtual
Reimplemented from ON_Object.
bool ON_Brep::MatchTrimEnds | ( | ON_BrepTrim & | T0, |
ON_BrepTrim & | T1 | ||
) |
Match the end of a trim to the start of the next trim.
T0 | [in] brep trim |
T1 | [in] brep trim that comes immediately after T0 in the same loop |
bool ON_Brep::MatchTrimEnds | ( | int | trim_index | ) |
Match the endpoints of a trim to the next and previous trim
trim_index | [in] index into m_T |
bool ON_Brep::MatchTrimEnds | ( | ON_BrepLoop & | Loop | ) |
Match the endpoints of all trims in a loop
Loop | [in] brep loop |
bool ON_Brep::MatchTrimEnds | ( | ) |
Match the endpoints of all trims in a brep
|
overridevirtual |
Override of virtual ON_Object::MemoryRelocate.
Reimplemented from ON_Object.
int ON_Brep::MergeFaces | ( | int | fid0, |
int | fid1 | ||
) |
If fid0 != fid1 and m_F[fid0] and m_F[fid1] have the same surface (m_si is identical), and they are joined along a set of edges that do not have any other faces, then this will combine the two faces into one.
TODODOC: fid0, fid1 - [in] indices into m_F of faces to be merged.
Caller should call Compact() when done.
bool ON_Brep::MergeFaces | ( | ) |
Merge all possible faces that have the same m_si
Caller should call Compact() when done.
|
static |
Use ON_Brep::New() instead of new ON_Brep() when writing Rhino plug-ins (or when openNURBS is used as a Microsoft DLL and you need to create a new ON_Brep in a different .EXE or .DLL).
When openNURBS is used as a Microsoft DLL, the CL.EXE compiler uses local vtables for classes that are new-ed in other executables but uses the ordinary vtable for for classes that are allocated in functions like ON_BrepCylinder(), ON_NurbsSurfaceQuadrilateral(), ON_Cylinder::RevSurfaceForm(nullptr), etc. Using static New() functions like ON_Brep::New() insures that identical classes has the same vtable and makes all code run identically.
Use ON_Brep::New(const ON_Brep& src) instead of new ON_Brep(const ON_Brep& src).
See static ON_Brep* ON_Brep::New() for details.
ON_BrepFace* ON_Brep::NewConeFace | ( | const ON_BrepVertex & | vertex, |
const ON_BrepEdge & | edge, | ||
bool | bRevEdge | ||
) |
Add a new face to the brep whose surface geometry is a ruled cone with the edge as the base and the vertex as the apex point.
vertex | [in] The apex of the cone will be at this vertex. The north side of the surface's parameter space will be a singular point at the vertex. |
edge | [in] The south side of the face's surface will run along this edge. |
bRevEdge | [in] true if the new face's outer boundary orientation along the edge is opposite the orientation of edge. |
ON_BrepTrim& ON_Brep::NewCurveOnFace | ( | ON_BrepFace & | face, |
ON_BrepEdge & | edge, | ||
bool | bRev3d = false , |
||
int | c2i = -1 |
||
) |
Add a new curve on face to the brep.
face | [in] face that curve lies on |
edge | [in] 3d edge associated with this curve on surface |
bRev3d | [in] true if the 3d edge and the 2d parameter space curve have opposite directions. |
c2i | [in] index of 2d curve in face's parameter space |
You should set the trim's ON_BrepTrim::m_tolerance and ON_BrepTrim::m_iso values.
ON_BrepEdge& ON_Brep::NewEdge | ( | int | = -1 | ) |
ON_BrepEdge& ON_Brep::NewEdge | ( | ON_BrepVertex & | , |
ON_BrepVertex & | , | ||
int | = -1 , |
||
const ON_Interval * | = nullptr , |
||
double | edge_tolerance = ON_UNSET_VALUE |
||
) |
ON_BrepFace& ON_Brep::NewFace | ( | int | si = -1 | ) |
Add a new face to a brep. An incomplete face is added. The caller must create and fill in the loops used by the face.
si | [in] index of surface in brep's m_S[] array |
Adding a new face may grow the dynamic m_F array. When this happens pointers and references to memory in the previous m_F[] array may become invalid. Use face indices if this is an issue.
ON_BrepFace* ON_Brep::NewFace | ( | const ON_Surface & | surface | ) |
Add a new face to a brep. This creates a complete face with new vertices at the surface corners, new edges along the surface boundary, etc. The loop of the returned face has four trims that correspond to the south, east, north, and west side of the surface in that order. If you use this version of NewFace to add an exiting brep, then you are responsible for using a tool like ON_Brep::JoinEdges() to hook the new face to its neighbors.
surface | [in] surface is copied. |
Adding a new face may grow the dynamic arrays used to store vertices, edges, faces, loops, and trims. When these dyamic arrays are grown, any pointers and references to memory in the previous arrays may become invalid. Use indices if this is an issue.
ON_BrepFace* ON_Brep::NewFace | ( | ON_Surface * | pSurface, |
int | vid[4], | ||
int | eid[4], | ||
bool | bRev3d[4] | ||
) |
Add a new face to brep. This version is for expert users.
pSurface | [in] the returned face will have an outer loop that goes around the edges of the surface. |
vid | [in/out] four vertex indices that specify the vertices at the (sw,se,nw,ne) corners. If the input value of a vertex index is -1, then the vertex will be created. |
eid | [in/out] four edge indices that specify the edges for the (south,east,north,west) sides. If the input value of an edge index is -1, then the edge will be created. |
bRev3d | [in/out] four values of the trim m_bRev3d flags of the (south,east,north,west) sides. |
Adding a new face may grow the dynamic m_F array. When this happens pointers and references to memory in the previous m_F[] array may become invalid. Use face indices if this is an issue.
ON_BrepLoop& ON_Brep::NewLoop | ( | ON_BrepLoop::TYPE | ) |
Create a new empty boundary loop. The new loop will not be part of a face and will not include any trim curves.
ON_BrepLoop& ON_Brep::NewLoop | ( | ON_BrepLoop::TYPE | loop_type, |
ON_BrepFace & | face | ||
) |
Create a new boundary loop on a face. After you get this ON_BrepLoop, you still need to create the vertices, edges, and trims that define the loop.
ON_BrepLoop* ON_Brep::NewOuterLoop | ( | int | face_index | ) |
Create a new outer boundary loop that runs along the sides of the face's surface. All the necessary trims, edges, and vertices are created and added to the brep.
face_index | [in] index of face that needs an outer boundary that runs along the sides of its surface. |
ON_BrepLoop* ON_Brep::NewOuterLoop | ( | int | face_index, |
int | vid[4], | ||
int | eid[4], | ||
bool | bRev3d[4] | ||
) |
Add a new face to brep. This version is for expert users.
face_index | [in] index of face that will get a new outer loop running around the sides of the face's underlying surface. |
vid | [in/out] four vertex indices that specify the vertices at the (sw,se,nw,ne) corners. If the input value of a vertex index is -1, then the vertex will be created. |
eid | [in/out] four edge indices that specify the edges for the (south,east,north,west) sides. If the input value of an edge index is -1, then the edge will be created. |
bRev3d | [in/out] four values of the trim m_bRev3d flags of the (south,east,north,west) sides. |
Adding a new loop may grow the dynamic m_L array. When this happens pointers and references to memory in the previous m_L[] array may become invalid. Use face indices if this is an issue.
bool ON_Brep::NewPlanarFaceLoop | ( | int | face_index, |
ON_BrepLoop::TYPE | loop_type, | ||
ON_SimpleArray< ON_Curve *> & | boundary, | ||
bool | bDuplicateCurves = true |
||
) |
Add a planar trimming loop to a planar face.
face_index | [in] index of planar face. The underlying suface must be an ON_PlaneSurface. |
loop_type | [in] type of loop to add. If loop_type is ON_BrepLoop::unknown, then the loop direction is tested and the the new loops type will be set to ON_BrepLoop::outer or ON_BrepLoop::inner. If the loop_type is ON_BrepLoop::outer, then the direction of the new loop is tested and flipped if it is clockwise. If the loop_type is ON_BrepLoop::inner, then the direction of the new loop is tested and flipped if it is counter-clockwise. |
boundary | [in] a list of 3d curves that form a simple (no self intersections) closed curve. These curves define the 3d edge geometry and should be near the planar surface. |
bDuplicateCurves | [in] If true, then duplicates of the curves in the boundary array are added to the brep. If false, the curves in the boundary array are added to the brep and will be deleted by ON_Brep::~ON_Brep. |
ON_BrepVertex& ON_Brep::NewPointOnFace | ( | ON_BrepFace & | face, |
double | s, | ||
double | t | ||
) |
Adds a new point on face to the brep.
face | [in] face that vertex lies on s,t - [in] surface parameters |
If a vertex is a point on a face, then brep.m_E[m_ei] will be an edge with no 3d curve. This edge will have a single trim with type ON_BrepTrim::ptonsrf. There will be a loop containing this single trim.
ON_BrepFace* ON_Brep::NewRuledFace | ( | const ON_BrepEdge & | edgeA, |
bool | bRevEdgeA, | ||
const ON_BrepEdge & | edgeB, | ||
bool | bRevEdgeB | ||
) |
Add a new face to the brep whose surface geometry is a ruled surface between two edges.
edgeA | [in] The south side of the face's surface will run along edgeA. |
bRevEdgeA | [in] true if the new face's outer boundary orientation along edgeA is opposite the orientation of edgeA. |
edgeB | [in] The north side of the face's surface will run along edgeA. |
bRevEdgeB | [in] true if the new face's outer boundary orientation along edgeB is opposite the orientation of edgeB. |
ON_BrepTrim& ON_Brep::NewSingularTrim | ( | const ON_BrepVertex & | vertex, |
ON_BrepLoop & | loop, | ||
ON_Surface::ISO | iso, | ||
int | c2i = -1 |
||
) |
Add a new singular trim to the brep.
vertex | [in] vertex along collapsed surface edge |
loop | [in] trim is appended to this loop |
iso | [in] one of ON_Surface::S_iso, ON_Surface::E_iso, ON_Surface::N_iso, or ON_Surface::W_iso. |
c2i | [in] index of 2d trimming curve |
ON_BrepTrim& ON_Brep::NewTrim | ( | int | c2i = -1 | ) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep.
c2i | [in] index of 2d trimming curve |
You should set the trim's ON_BrepTrim::m_tolerance, ON_BrepTrim::m_type, ON_BrepTrim::m_iso, ON_BrepTrim::m_li, and ON_BrepTrim::m_ei values. In general, you should try to use the ON_BrepTrim::NewTrim( edge, bRev3d, loop, c2i ) version of NewTrim. If you want to add a singular trim, use ON_Brep::NewSingularTrim. If you want to add a crvonsrf trim, use ON_Brep::NewCurveOnFace. If you want to add a ptonsrf trim, use ON_Brep::NewPointOnFace.
ON_BrepTrim& ON_Brep::NewTrim | ( | bool | bRev3d, |
ON_BrepLoop & | loop, | ||
int | c2i = -1 |
||
) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep.
bRev3d | [in] ON_BrepTrim::m_bRev3d value. true if the edge and trim have opposite directions. |
loop | [in] trim is appended to this loop |
c2i | [in] index of 2d trimming curve |
You should set the trim's ON_BrepTrim::m_tolerance, ON_BrepTrim::m_type, ON_BrepTrim::m_iso, and ON_BrepTrim::m_ei values. In general, you should try to use the ON_BrepTrim::NewTrim( edge, bRev3d, loop, c2i ) version of NewTrim. If you want to add a singular trim, use ON_Brep::NewSingularTrim. If you want to add a crvonsrf trim, use ON_Brep::NewCurveOnFace. If you want to add a ptonsrf trim, use ON_Brep::NewPointOnFace.
ON_BrepTrim& ON_Brep::NewTrim | ( | ON_BrepEdge & | edge, |
bool | bRev3d, | ||
int | c2i = -1 |
||
) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep.
edge | [in] 3d edge associated with this trim |
bRev3d | [in] ON_BrepTrim::m_bRev3d value. true if the edge and trim have opposite directions. |
c2i | [in] index of 2d trimming curve |
You should set the trim's ON_BrepTrim::m_tolerance, ON_BrepTrim::m_type, ON_BrepTrim::m_iso, and ON_BrepTrim::m_li values. In general, you should try to use the ON_BrepTrim::NewTrim( edge, bRev3d, loop, c2i ) version of NewTrim. If you want to add a singular trim, use ON_Brep::NewSingularTrim. If you want to add a crvonsrf trim, use ON_Brep::NewCurveOnFace. If you want to add a ptonsrf trim, use ON_Brep::NewPointOnFace.
ON_BrepTrim& ON_Brep::NewTrim | ( | ON_BrepEdge & | edge, |
bool | bRev3d, | ||
ON_BrepLoop & | loop, | ||
int | c2i = -1 |
||
) |
Add a new trim that will be part of an inner, outer, or slit loop to the brep.
edge | [in] 3d edge associated with this trim |
bRev3d | [in] ON_BrepTrim::m_bRev3d value. true if the edge and trim have opposite directions. |
loop | [in] trim is appended to this loop |
c2i | [in] index of 2d trimming curve |
You should set the trim's ON_BrepTrim::m_tolerance values. If c2i is -1, you must set the trim's ON_BrepTrim::m_iso values. This version of NewTrim sets the trim.m_type value. If the input edge or loop are not currently valid, then you may need to adjust the trim.m_type value. If you want to add a singular trim, use ON_Brep::NewSingularTrim. If you want to add a crvonsrf trim, use ON_Brep::NewCurveOnFace. If you want to add a ptonsrf trim, use ON_Brep::NewPointOnFace.
ON_BrepVertex& ON_Brep::NewVertex | ( | ) |
ON_BrepVertex& ON_Brep::NewVertex | ( | ON_3dPoint | vertex_point, |
double | vertex_tolerance = ON_UNSET_VALUE |
||
) |
int ON_Brep::NextEdge | ( | int | current_edge_index, |
int | endi, | ||
int * | next_endi = nullptr |
||
) | const |
This is a simple tool for getting running through the edges that begin and end at a vertex.
current_edge_index | [in] |
endi | [in] 0 = use the edge start vertex, 1 = use the edge end vertex |
next_endi | [out] 0 if next edge begins at the vertex, 1 if next edge ends at the vertex |
This is a tool that simplifies searching through the ON_BrepVertex.m_ei[] array. The edges are in no particular order.
int ON_Brep::NextNonsingularTrim | ( | int | ) | const |
int ON_Brep::NextTrim | ( | int | ) | const |
|
overridevirtual |
virtual ON_Objet::ObjectType() override
Reimplemented from ON_Object.
int ON_Brep::PrevEdge | ( | int | current_edge_index, |
int | endi, | ||
int * | prev_endi = nullptr |
||
) | const |
This is a simple tool for getting running through the edges that begin and end at a vertex.
current_edge_index | [in] |
endi | [in] 0 = use the edge start vertex, 1 = use the edge end vertex |
prev_endi | [out] 0 if previous edge begins at the vertex, 1 if previous edge ends at the vertex |
This is a tool that simplifies searching through the ON_BrepVertex.m_ei[] array. The edges are in no particular order.
int ON_Brep::PrevNonsingularTrim | ( | int | ) | const |
Same as NextTrim and PrevTrim, but skips over trims with type singular.
int ON_Brep::PrevTrim | ( | int | ) | const |
Navigation Interface.
for moving around loops - returns trim index of prev/next trim in loop
|
overridevirtual |
virtual ON_Objet::Read() override
Reimplemented from ON_Object.
|
protected |
|
protected |
|
protected |
read helpers to support various versions
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
helpers for reading legacy v1 trimmed surfaces and breps
const ON_BrepRegionTopology& ON_Brep::RegionTopology | ( | ) | const |
Get region topology information: In order to keep the ON_Brep class efficient, rarely used region topology information is not maintained. If you require this information, call RegionTopology().
bool ON_Brep::RemoveNesting | ( | bool | bExtractSingleSegments, |
bool | bEdges = true , |
||
bool | bTrimCurves = true |
||
) |
Removes nested polycurves from the m_C2[] and m_C3[] arrays.
bExtractSingleSegments | [in] if true, polycurves with a single segment are replaced with the segment curve. |
bEdges | [in] if true, the m_C3[] array is processed |
bTrimCurves | [in] if true, the m_C2[] array is processed. |
bool ON_Brep::RemoveSlits | ( | ) |
remove slit trims and slit boundaries from each face.
Caller should call Compact() afterwards.
bool ON_Brep::RemoveSlits | ( | ON_BrepFace & | F | ) |
remove slit trims and slit boundaries from a face.
F | [in] brep face |
Caller should call Compact() when done.
bool ON_Brep::RemoveSlits | ( | ON_BrepLoop & | L | ) |
remove slit trims from a loop.
L | [in] brep loop |
Caller should call Compact() when done. If all trims are removed, the loop will be marked as deleted.
int ON_Brep::RemoveWireEdges | ( | bool | bDeleteVertices = true | ) |
Remove edges that are not connected to a face.
bDeleteVertices | [in] if true, then the vertices at the ends of the wire edges are deleted if they are not connected to face trimming edges. |
After you finish cleaning up the brep, you need to call ON_Brep::Compact() to remove unused edge, trim, and vertex information from the brep's m_E[], m_V[], m_T[], m_C2[], and m_C3[] arrays.
If you want to remove wire edges and wiere After you finish cleaning up the brep, you need to call ON_Brep::Compact() to remove deleted vertices from the m_V[] array.
int ON_Brep::RemoveWireVertices | ( | ) |
Remove vertices that are not connected to an edge.
After you finish cleaning up the brep, you need to call ON_Brep::Compact() to remove deleted vertices from the m_V[] array.
void ON_Brep::Set_user | ( | ON_U | u | ) | const |
"Expert" Interface
|
overridevirtual |
virtual
Reimplemented from ON_Object.
|
overridevirtual |
virtual
Reimplemented from ON_Object.
bool ON_Brep::SetEdgeCurve | ( | ON_BrepEdge & | edge, |
int | c3_index, | ||
const ON_Interval * | sub_domain = nullptr |
||
) |
Set 3d curve geometry used by a b-rep edge.
edge | [in] |
c3_index | [in] index of 3d curve in m_C3[] array |
sub_domain | [in] if not nullptr, sub_domain is an increasing sub interval of m_C3[c3_index]->Domain(). |
bool ON_Brep::SetEdgeDomain | ( | int | , |
const ON_Interval & | |||
) |
|
virtual |
bool ON_Brep::SetEdgeTolerances | ( | bool | bLazy = false | ) |
Set the brep's edge tolerances.
bLazy | [in] if true, only edge tolerances with the value ON_UNSET_VALUE will be set. If false, the edge tolerance is recomputed from the geometry in the brep. |
|
protected |
helpers to create and set vertices
|
protected |
void ON_Brep::SetTolerancesBoxesAndFlags | ( | bool | bLazy = false , |
bool | bSetVertexTolerances = true , |
||
bool | bSetEdgeTolerances = true , |
||
bool | bSetTrimTolerances = true , |
||
bool | bSetTrimIsoFlags = true , |
||
bool | bSetTrimTypeFlags = true , |
||
bool | bSetLoopTypeFlags = true , |
||
bool | bSetTrimBoxes = true |
||
) |
Set tolerances and flags in a brep
bLazy | [in] if true, only flags and tolerances that are not set will be calculated. |
bSetVertexTolerances | [in] true to compute vertex.m_tolerance values |
bSetEdgeTolerances | [in] true to compute edge.m_tolerance values |
bSetTrimTolerances | [in] true to compute trim.m_tolerance[0,1] values |
bSetTrimIsoFlags | [in] true to compute trim.m_iso values |
bSetTrimTypeFlags | [in] true to compute trim.m_type values |
bSetLoopTypeFlags | [in] true to compute loop.m_type values |
bSetTrimBoxes | [in] true to compute trim.m_pbox values |
|
protected |
|
virtual |
Set the trim parameter space bounding box (trim.m_pbox).
trim | [in] |
bLazy | [in] if true and trim.m_pbox is valid, then the box is not set. |
|
virtual |
Set the loop parameter space bounding box (loop.m_pbox).
loop | [in] |
bLazy | [in] if true and loop trim trim.m_pbox is valid, then that trim.m_pbox is not recalculated. |
|
virtual |
Set the loop and trim parameter space bounding boxes for every loop and trim in the face
face | [in] |
bLazy | [in] if true and trim trim.m_pbox is valid, then that trim.m_pbox is not recalculated. |
|
virtual |
Set the loop and trim parameter space bounding boxes for every loop and trim in the brep.
bLazy | [in] if true and trim trim.m_pbox is valid, then that trim.m_pbox is not recalculated. |
bool ON_Brep::SetTrimCurve | ( | ON_BrepTrim & | trim, |
int | c2_index, | ||
const ON_Interval * | sub_domain = nullptr |
||
) |
Set 2d curve geometry used by a b-rep trim.
trim | [in] |
c2_index | [in] index of 2d curve in m_C2[] array |
sub_domain | [in] if not nullptr, sub_domain is an increasing sub interval of m_C2[c2_index]->Domain(). |
bool ON_Brep::SetTrimDomain | ( | int | , |
const ON_Interval & | |||
) |
|
protected |
helpers to set ON_BrepTrim::m_iso flag
|
protected |
bool ON_Brep::SetTrimIsoFlags | ( | ) |
bool ON_Brep::SetTrimIsoFlags | ( | ON_BrepFace & | ) |
bool ON_Brep::SetTrimIsoFlags | ( | ON_BrepLoop & | ) |
bool ON_Brep::SetTrimIsoFlags | ( | ON_BrepTrim & | ) |
|
protected |
|
virtual |
bool ON_Brep::SetTrimTolerances | ( | bool | bLazy = false | ) |
Set the brep's trim tolerances.
bLazy | [in] if true, only trim tolerances with the value ON_UNSET_VALUE will be set. If false, the trim tolerance is recomputed from the geometry in the brep. |
bool ON_Brep::SetTrimTypeFlags | ( | bool | bLazy = false | ) |
bool ON_Brep::SetTrimTypeFlags | ( | ON_BrepFace & | , |
bool | bLazy = false |
||
) |
bool ON_Brep::SetTrimTypeFlags | ( | ON_BrepLoop & | , |
bool | bLazy = false |
||
) |
bool ON_Brep::SetTrimTypeFlags | ( | ON_BrepTrim & | , |
bool | bLazy = false |
||
) |
bool ON_Brep::SetVertexTolerance | ( | ON_BrepVertex & | vertex, |
bool | bLazy = false |
||
) | const |
bool ON_Brep::SetVertexTolerances | ( | bool | bLazy = false | ) |
Set the brep's vertex tolerances.
bLazy | [in] if true, only vertex tolerances with the value ON_UNSET_VALUE will be set. If false, the vertex tolerance is recomputed from the geometry in the brep. |
void ON_Brep::SetVertices | ( | void | ) |
bool ON_Brep::ShrinkSurface | ( | ON_BrepFace & | face, |
int | DisableSide = 0 |
||
) |
Sometimes the ON_Surface used by a face extends far beyond the face's outer boundary. ShrinkSurface uses ON_Surface::Trim to remove portions of the surface that extend beyond the face's outer boundary loop.
face | [in] face to test and whose surface should be shrunk. |
DisableSide | [in] This is a bit field. A set bit indicates not to shrink the surface on a given side. The default of 0 enables shrinking on all four sides. value meaning 0x0001 Dont shrink on the west side of domain. 0x0002 Dont shrink on the south side of domain. 0x0004 Dont shrink on the east side of domain. 0x0008 Dont shrink on the north side of domain. |
If a surface needs to be shrunk it is copied. After shrinking, you may want to call ON_Brep::CullUnusedSurfaces to remove any unused surfaces.
bool ON_Brep::ShrinkSurfaces | ( | ) |
Sometimes the ON_Surface used by a face extends far beyond the face's outer boundary. ShrinkSurfaces calls ON_Shrink::ShrinkSurface on each face to remove portions of surfaces that extend beyond their face's outer boundary loop.
If a surface needs to be shrunk it is copied. After shrinking, you may want to call ON_Brep::CullUnusedSurfaces to remove any unused surfaces.
|
overridevirtual |
virtual ON_Object::SizeOf override
Reimplemented from ON_Object.
|
virtual |
Determine orientation of a brep.
The base class implementation returns 2 or 0. This function is overridden in the Rhino SDK and returns +1, -1, or 0.
bool ON_Brep::SortFaceLoops | ( | ON_BrepFace & | face | ) | const |
Sort the face.m_li[] array by loop type (outer, inner, slit, crvonsrf, ptonsrf)
face | [in/out] face whose m_li[] array should be sorted. |
void ON_Brep::Standardize | ( | ) |
Standardize all trims, edges, and faces in the brep.
After standardizing, there may be unused curves and surfaces in the brep. Call ON_Brep::Compact to remove these unused curves and surfaces.
bool ON_Brep::StandardizeEdgeCurve | ( | int | edge_index, |
bool | bAdjustEnds | ||
) |
Standardizes the relationship between an ON_BrepEdge and the 3d curve it uses. When done, the edge will be the only edge that references its 3d curve, the domains of the edge and 3d curve will be the same, and the edge will use the entire locus of the 3d curve.
edge_index | [in] index of edge to standardize. |
bAdjustEnds | [in] if true, move edge curve endpoints to vertices |
bool ON_Brep::StandardizeEdgeCurve | ( | int | edge_index, |
bool | bAdjustEnds, | ||
int | EdgeCurveUse | ||
) |
Expert user only. Same as above, but to be used when the edge curve use count is known for the edge. Standardizes the relationship between an ON_BrepEdge and the 3d curve it uses. When done, the edge will be the only edge that references its 3d curve, the domains of the edge and 3d curve will be the same, and the edge will use the entire locus of the 3d curve.
edge_index | [in] index of edge to standardize. |
bAdjustEnds | [in] if true, move edge curve endpoints to vertices |
EdgeCurveUse | [in] if > 1, then the edge curve for this edge is used by more than one edge. if 1, then the edge curve is used only for this edge. If <= 0, then use count is unknown. |
void ON_Brep::StandardizeEdgeCurves | ( | bool | bAdjustEnds | ) |
Standardize all edges in the brep.
bAdjustEnds | [in] if true, move edge curve endpoints to vertices |
bool ON_Brep::StandardizeFaceSurface | ( | int | face_index | ) |
Standardizes the relationship between an ON_BrepFace and the 3d surface it uses. When done, the face will be the only face that references its 3d surface, and the orientations of the face and 3d surface will be the same.
face_index | [in] index of face to standardize. |
void ON_Brep::StandardizeFaceSurfaces | ( | ) |
Standardize all faces in the brep.
bool ON_Brep::StandardizeTrimCurve | ( | int | trim_index | ) |
Standardizes the relationship between an ON_BrepTrim and the 2d curve it uses. When done, the trim will be the only trim that references its 2d curve, the domains of the trim and 2d curve will be the same, and the trim will use the entire locus of the 2d curve.
trim_index | [in] index of trim to standardize. |
void ON_Brep::StandardizeTrimCurves | ( | ) |
Standardize all trims in the brep.
Copy a subset of this brep.
subfi_count | [in] length of sub_fi[] array. |
sub_fi | [in] array of face indices in this brep to copy. (If any values inf sub_fi[] are out of range or if sub_fi[] contains duplicates, this function will return null.) |
sub_brep | [in] if this pointer is not null, then the subbrep will be created in this class. |
int ON_Brep::SurfaceUseCount | ( | int | surface_index, |
int | max_count = 0 |
||
) | const |
Query Interface.
Determine how many brep faces reference m_S[surface_index].
surface_index | [in] index of the surface in m_S[] array |
max_count | [in] counting stops if max_count > 0 and at least max_count faces use the surface. |
|
overridevirtual |
virtual ON_Geometry::SwapCoordinates() override
Reimplemented from ON_Geometry.
|
protected |
helpers for SwapFaceParameters()
|
protected |
|
overridevirtual |
virtual ON_Geometry::Transform() override
Reimplemented from ON_Geometry.
ON_BrepTrim* ON_Brep::Trim | ( | int | trim_index | ) | const |
Get trim from trim index or component index.
trim_index | [in] either an index into m_T[] or a component index of type brep_trim. |
ON_BrepTrim* ON_Brep::Trim | ( | ON_COMPONENT_INDEX | trim_index | ) | const |
int ON_Brep::TrimCurveUseCount | ( | int | c2_index, |
int | max_count = 0 |
||
) | const |
Determine how many brep trims reference m_C2[c2_index].
c2_index | [in] index of the 2d curve in m_C2[] array |
max_count | [in] counting stops if max_count > 0 and at least max_count trims use the 2d curve. |
ON_BrepTrim::TYPE ON_Brep::TrimType | ( | const ON_BrepTrim & | trim, |
bool | bLazy = true |
||
) | const |
Calculate the type (singular, mated, boundary, etc.) of an ON_BrepTrim object.
trim | [in] |
bLazy | [in] if true and trim.m_type is set to something other than ON_BrepTrim::unknown, then no calculation is performed and the value of trim.m_type is returned. If false, the value of trim.m_type is ignored and is caluculated. |
The trim must be connected to a valid loop.
ON_BrepVertex* ON_Brep::Vertex | ( | int | vertex_index | ) | const |
Get vertex from trim index or component index.
vertex_index | [in] either an index into m_V[] or a component index of type brep_vertex. |
ON_BrepVertex* ON_Brep::Vertex | ( | ON_COMPONENT_INDEX | vertex_index | ) | const |
|
overridevirtual |
virtual ON_Objet::Write() override
Reimplemented from ON_Object.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
mutableprotected |
|
protected |
|
mutable |
ON_CurveArray ON_Brep::m_C2 |
ON_CurveArray ON_Brep::m_C3 |
ON_BrepEdgeArray ON_Brep::m_E |
ON_BrepFaceArray ON_Brep::m_F |
|
protected |
ON_BrepLoopArray ON_Brep::m_L |
|
protected |
ON_SurfaceArray ON_Brep::m_S |
ON_BrepTrimArray ON_Brep::m_T |
ON_BrepVertexArray ON_Brep::m_V |