#include <opennurbs_brep.h>

Inheritance diagram for ON_Brep:
ON_Geometry ON_Object

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_GeometryBrepComponent (ON_COMPONENT_INDEX ci) const
 Get a brep component from its index. More...
 
ON_BrepBrepForm (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_BrepEdgeCombineContiguousEdges (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_BrepDuplicateFace (int face_index, bool bDuplicateMeshes) const
 Duplicate a single brep face. More...
 
ON_BrepDuplicateFaces (int face_count, const int *face_index, bool bDuplicateMeshes) const
 Duplicate a a subset of a brep More...
 
ON_BrepEdgeEdge (int edge_index) const
 Get edge from edge index or component index. More...
 
ON_BrepEdgeEdge (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_BrepExtractFace (int face_index)
 Extract a face from a brep. More...
 
ON_BrepFaceFace (int face_index) const
 Get face from face index or component index. More...
 
ON_BrepFaceFace (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_BrepLoopLoop (int loop_index) const
 Get loop from loop index or component index. More...
 
ON_BrepLoopLoop (ON_COMPONENT_INDEX loop_index) const
 
ON_CurveLoop2dCurve (const ON_BrepLoop &loop) const
 Get a 3d curve that traces the entire loop More...
 
ON_CurveLoop3dCurve (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_NurbsCurveMakeTrimCurveNurb (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_BrepFaceNewConeFace (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_BrepTrimNewCurveOnFace (ON_BrepFace &face, ON_BrepEdge &edge, bool bRev3d=false, int c2i=-1)
 Add a new curve on face to the brep. More...
 
ON_BrepEdgeNewEdge (int=-1)
 
ON_BrepEdgeNewEdge (ON_BrepVertex &, ON_BrepVertex &, int=-1, const ON_Interval *=nullptr, double edge_tolerance=ON_UNSET_VALUE)
 
ON_BrepFaceNewFace (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_BrepFaceNewFace (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_BrepFaceNewFace (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_BrepLoopNewLoop (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_BrepLoopNewLoop (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_BrepLoopNewOuterLoop (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_BrepLoopNewOuterLoop (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_BrepVertexNewPointOnFace (ON_BrepFace &face, double s, double t)
 Adds a new point on face to the brep. More...
 
ON_BrepFaceNewRuledFace (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_BrepTrimNewSingularTrim (const ON_BrepVertex &vertex, ON_BrepLoop &loop, ON_Surface::ISO iso, int c2i=-1)
 Add a new singular trim to the brep. More...
 
ON_BrepTrimNewTrim (int c2i=-1)
 Add a new trim that will be part of an inner, outer, or slit loop to the brep. More...
 
ON_BrepTrimNewTrim (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_BrepTrimNewTrim (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_BrepTrimNewTrim (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_BrepVertexNewVertex ()
 
ON_BrepVertexNewVertex (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_Brepoperator= (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_BrepRegionTopologyRegionTopology () 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_BrepSubBrep (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_BrepTrimTrim (int trim_index) const
 Get trim from trim index or component index. More...
 
ON_BrepTrimTrim (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_BrepVertexVertex (int vertex_index) const
 Get vertex from trim index or component index. More...
 
ON_BrepVertexVertex (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_Geometryoperator= (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_UserDataFirstUserData () 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_UserDataGetUserData (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_Objectoperator= (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_BrepNew ()
 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_BrepNew (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_CurveRead100_BrepCurve (ON_BinaryArchive &) const
 
ON_SurfaceRead100_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_BrepRegionTopologyInternal_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_BrepRegionTopologym_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
 

Constructor & Destructor Documentation

◆ ON_Brep() [1/2]

ON_Brep::ON_Brep ( )

Construction.

◆ ~ON_Brep()

ON_Brep::~ON_Brep ( )

◆ ON_Brep() [2/2]

ON_Brep::ON_Brep ( const ON_Brep )

Member Function Documentation

◆ AddEdgeCurve()

int ON_Brep::AddEdgeCurve ( ON_Curve )

◆ AddSurface()

int ON_Brep::AddSurface ( ON_Surface )

◆ AddTrimCurve()

int ON_Brep::AddTrimCurve ( ON_Curve )

Creation Interface.

◆ AggregateComponentStatus()

ON_AggregateComponentStatus ON_Brep::AggregateComponentStatus ( ) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ Append()

void ON_Brep::Append ( const ON_Brep )

◆ BrepComponent()

const ON_Geometry* ON_Brep::BrepComponent ( ON_COMPONENT_INDEX  ci) const

Get a brep component from its index.

Parameters
component_index[in]
Returns
A const pointer to the component. Do not delete the returned object. It points to an object managed by this brep.
See also
ON_Brep::Face, ON_Brep::Edge, ON_Brep::Loop, ON_Brep::Trim, ON_Brep::Vertex

◆ BrepForm()

ON_Brep* ON_Brep::BrepForm ( ON_Brep brep = nullptr) const
overridevirtual

If possible, BrepForm() creates a brep form of the ON_Geometry.

Parameters
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.

◆ ChangeVertex()

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.

Parameters
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.
Returns
True if successful.

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.

◆ Clear_edge_user_i() [1/2]

void ON_Brep::Clear_edge_user_i ( int  ) const

◆ Clear_edge_user_i() [2/2]

void ON_Brep::Clear_edge_user_i ( ) const

◆ Clear_face_user_i()

void ON_Brep::Clear_face_user_i ( ) const

◆ Clear_loop_user_i()

void ON_Brep::Clear_loop_user_i ( ) const

◆ Clear_trim_user_i()

void ON_Brep::Clear_trim_user_i ( ) const

◆ Clear_user_i()

void ON_Brep::Clear_user_i ( ) const

◆ Clear_vertex_user_i()

void ON_Brep::Clear_vertex_user_i ( ) const

◆ ClearBoundingBox()

void ON_Brep::ClearBoundingBox ( )
overridevirtual

virtual ON_Geometry::ClearBoundingBox() override

Reimplemented from ON_Geometry.

◆ ClearComponentStates() [1/2]

unsigned int ON_Brep::ClearComponentStates ( ON_ComponentStatus  states_to_clear) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ ClearComponentStates() [2/2]

unsigned int ON_Brep::ClearComponentStates ( ON_COMPONENT_INDEX  component_index,
ON_ComponentStatus  states_to_clear 
) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ ClearEdgeVertices()

void ON_Brep::ClearEdgeVertices ( )
protected

◆ ClearTrimVertices()

void ON_Brep::ClearTrimVertices ( )
protected

◆ CloseTrimGap()

bool ON_Brep::CloseTrimGap ( ON_BrepTrim trim0,
ON_BrepTrim trim1 
)

Expert user tool to remove any gap between adjacent trims.

Parameters
trim0[in]
trim1[in]
Returns
True if successful.

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.

◆ CollapseEdge()

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.

Parameters
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.
Returns
True if edge was successfully collapsed.

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.

◆ CombineCoincidentEdges()

bool ON_Brep::CombineCoincidentEdges ( ON_BrepEdge ,
ON_BrepEdge  
)

Expert user function.

See also
ON_Brep::JoinEdges

◆ CombineCoincidentVertices()

bool ON_Brep::CombineCoincidentVertices ( ON_BrepVertex ,
ON_BrepVertex  
)

Expert user function.

See also
ON_Brep::JoinEdges

◆ CombineContiguousEdges()

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]

Returns
Pointer to the new edge or nullptr if the edges cannot be combined into a single edge.

The input edges are deleted but are still in the brep's m_E[] arrays. Use ON_Brep::Compact to remove the unused edges.

◆ Compact()

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.

See also
ON_Brep::CullUnusedFaces, ON_Brep::CullUnusedLoops, ON_Brep::CullUnusedTrims, ON_Brep::CullUnusedEdges, ON_Brep::CullUnusedVertices, ON_Brep::CullUnused3dCurves, ON_Brep::CullUnused2dCurves, ON_Brep::CullUnusedSurfaces

◆ ComputeLoopType()

ON_BrepLoop::TYPE ON_Brep::ComputeLoopType ( const ON_BrepLoop ) const

◆ Create() [1/5]

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.

Parameters
pSurface[in] pointer to a surface. The brep will manage this pointer and delete it in ~ON_Brep.
Returns
table true successful When true is returned, the pSurface pointer is added to the brep's m_S[] array and it will be deleted by the brep's destructor. false brep cannot be created from this surface. When false is returned, then the caller is responsible for deleting pSurface unless it was previously added to the brep's m_S[] array.

The surface class must be created with new so that the delete in ~ON_Brep will not cause a crash.

◆ Create() [2/5]

bool ON_Brep::Create ( ON_NurbsSurface *&  pNurbsSurface)

◆ Create() [3/5]

bool ON_Brep::Create ( ON_PlaneSurface *&  pPlaneSurface)

◆ Create() [4/5]

bool ON_Brep::Create ( ON_RevSurface *&  pRevSurface)

◆ Create() [5/5]

bool ON_Brep::Create ( ON_SumSurface *&  pSumSurface)

◆ CreateMesh()

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.

Parameters
mp[in] meshing parameters
mesh_list[out] meshes are appended to this array.
Returns
Number of meshes appended to mesh_list[] array.

◆ CullUnused2dCurves()

bool ON_Brep::CullUnused2dCurves ( )

◆ CullUnused3dCurves()

bool ON_Brep::CullUnused3dCurves ( )

◆ CullUnusedEdges()

bool ON_Brep::CullUnusedEdges ( )

◆ CullUnusedFaces()

bool ON_Brep::CullUnusedFaces ( )

◆ CullUnusedLoops()

bool ON_Brep::CullUnusedLoops ( )

◆ CullUnusedSurfaces()

bool ON_Brep::CullUnusedSurfaces ( )

◆ CullUnusedTrims()

bool ON_Brep::CullUnusedTrims ( )

◆ CullUnusedVertices()

bool ON_Brep::CullUnusedVertices ( )

◆ DataCRC()

ON__UINT32 ON_Brep::DataCRC ( ON__UINT32  current_remainder) const
overridevirtual

virtual ON_Object::DataCRC override

Reimplemented from ON_Object.

◆ Delete2dCurve()

void ON_Brep::Delete2dCurve ( int  c2_index)

◆ Delete3dCurve()

void ON_Brep::Delete3dCurve ( int  c3_index)

◆ DeleteEdge()

void ON_Brep::DeleteEdge ( ON_BrepEdge edge,
bool  bDeleteEdgeVertices 
)

◆ DeleteFace()

void ON_Brep::DeleteFace ( ON_BrepFace face,
bool  bDeleteFaceEdges 
)

◆ DeleteLoop()

void ON_Brep::DeleteLoop ( ON_BrepLoop loop,
bool  bDeleteLoopEdges 
)

◆ DeleteSurface()

void ON_Brep::DeleteSurface ( int  s_index)

◆ DeleteTrim()

void ON_Brep::DeleteTrim ( ON_BrepTrim trim,
bool  bDeleteTrimEdges 
)

◆ DeleteVertex()

void ON_Brep::DeleteVertex ( ON_BrepVertex vertex)

◆ Destroy()

void ON_Brep::Destroy ( )

construction/destruction helpers

returns Brep to state it has after default construction

◆ DestroyMesh()

void ON_Brep::DestroyMesh ( ON::mesh_type  mesh_type,
bool  bDeleteMesh = true 
)

Destroy meshes used to render and analyze brep.

Parameters
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.
See also
ON_Brep::GetMesh, ON_BrepFace::DestroyMesh, ON_BrepFace::Mesh, ON_BrepFace::SetMesh

◆ DestroyRegionTopology()

void ON_Brep::DestroyRegionTopology ( )

Destroy region topology information.

◆ DestroyRuntimeCache()

void ON_Brep::DestroyRuntimeCache ( bool  bDelete = true)
overridevirtual

virtual ON_Object::DestroyRuntimeCache override

Reimplemented from ON_Object.

◆ Dimension()

int ON_Brep::Dimension ( ) const
overridevirtual

virtual ON_Geometry::Dimension() override

Reimplemented from ON_Geometry.

◆ DisconnectEdgeFaces()

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.

◆ Dump()

void ON_Brep::Dump ( ON_TextLog ) const
overridevirtual

virtual ON_Objet::Dump() override

Reimplemented from ON_Object.

◆ DuplicateFace()

ON_Brep* ON_Brep::DuplicateFace ( int  face_index,
bool  bDuplicateMeshes 
) const

Duplicate a single brep face.

Parameters
face_index[in] index of face to duplicate
bDuplicateMeshes[in] if true, any attached meshes are duplicated
Returns
Single face brep.

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.

See also
ON_Brep::DeleteFace, ON_Brep::ExtractFace

◆ DuplicateFaces()

ON_Brep* ON_Brep::DuplicateFaces ( int  face_count,
const int *  face_index,
bool  bDuplicateMeshes 
) const

Duplicate a a subset of a brep

Parameters
face_count[in] length of face_index[] array
face_index[in] array of face indices
bDuplicateMeshes[in] if true, any attached meshes are duplicated
Returns
A brep made by duplicating the faces listed in the face_index[] array.

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.

See also
ON_Brep::DuplicateFace

◆ Edge() [1/2]

ON_BrepEdge* ON_Brep::Edge ( int  edge_index) const

Get edge from edge index or component index.

Parameters
edge_index[in] either an index into m_E[] or a component index of type brep_edge.
Returns
If the index is a valid edge index or a valid edge component index, then a pointer to the ON_BrepEdge is returned. Otherwise nullptr is returned. See Also ON_Brep::Component( const ON_BrepEdge& )

◆ Edge() [2/2]

ON_BrepEdge* ON_Brep::Edge ( ON_COMPONENT_INDEX  edge_index) const

◆ EdgeCurveUseCount()

int ON_Brep::EdgeCurveUseCount ( int  c3_index,
int  max_count = 0 
) const

Determine how many brep edges reference m_C3[c3_index].

Parameters
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.
Returns
Number of brep edges that reference the 3d curve.

◆ EmergencyDestroy()

void ON_Brep::EmergencyDestroy ( )

call if memory pool used by b-rep members becomes invalid

◆ EvaluatePoint()

bool ON_Brep::EvaluatePoint ( const class ON_ObjRef objref,
ON_3dPoint P 
) const
overridevirtual

virtual ON_Geometry override

Reimplemented from ON_Geometry.

◆ ExtractFace()

ON_Brep* ON_Brep::ExtractFace ( int  face_index)

Extract a face from a brep.

Parameters
face_index[in] index of face to extract
Returns
Single face brep.
See also
ON_Brep::DeleteFace, ON_Brep::DuplicateFace

◆ Face() [1/2]

ON_BrepFace* ON_Brep::Face ( int  face_index) const

Get face from face index or component index.

Parameters
face_index[in] either an index into m_F[] or a component index of type brep_face.
Returns
If the index is a valid face index or a valid face component index, then a pointer to the ON_BrepFace is returned. Otherwise nullptr is returned. See Also ON_Brep::Component( const ON_BrepFace& )

◆ Face() [2/2]

ON_BrepFace* ON_Brep::Face ( ON_COMPONENT_INDEX  face_index) const

◆ FaceIsSurface()

bool ON_Brep::FaceIsSurface ( int  ) const

◆ Flip()

void ON_Brep::Flip ( )

◆ FlipFace()

void ON_Brep::FlipFace ( ON_BrepFace )

reverses orientation of a face by toggling ON_BrepFace::m_bRev

◆ FlipLoop()

void ON_Brep::FlipLoop ( ON_BrepLoop )

◆ FlipReversedSurfaces()

bool ON_Brep::FlipReversedSurfaces ( )

Modification Interface.

◆ GetBBox()

bool ON_Brep::GetBBox ( double *  boxmin,
double *  boxmax,
bool  bGrowBox = false 
) const
overridevirtual

virtual ON_Geometry GetBBox override

Reimplemented from ON_Geometry.

◆ GetComponentsWithSetStates()

unsigned int ON_Brep::GetComponentsWithSetStates ( ON_ComponentStatus  states_filter,
bool  bAllEqualStates,
ON_SimpleArray< ON_COMPONENT_INDEX > &  components 
) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ GetConnectedComponents()

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.

Parameters
components[in] connected components are appended to this array.
bDuplicateMeshes[in] if true, any meshes on this brep are copied to the output breps.
Returns
Number of connected components appended to components[] or zero if this brep has only one connected component.
See also
ON_Brep::GetConnectedComponents

◆ GetMesh()

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.

Parameters
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.
Returns
Number of meshes added to array. (Same as m_F.Count())
See also
ON_Brep::DestroyMesh, ON_BrepFace::DestroyMesh, ON_BrepFace::Mesh, ON_BrepFace::SetMesh

◆ GetTightBoundingBox()

bool ON_Brep::GetTightBoundingBox ( class ON_BoundingBox tight_bbox,
bool  bGrowBox = false,
const class ON_Xform xform = nullptr 
) const
overridevirtual

virtual ON_Geometry GetTightBoundingBox override

Reimplemented from ON_Geometry.

◆ GetTrim2dEnd()

bool ON_Brep::GetTrim2dEnd ( int  ,
ON_2dPoint  
) const

◆ GetTrim2dStart()

bool ON_Brep::GetTrim2dStart ( int  trim_index,
ON_2dPoint  
) const

◆ GetTrim3dEnd()

bool ON_Brep::GetTrim3dEnd ( int  ,
ON_3dPoint  
) const

◆ GetTrim3dStart()

bool ON_Brep::GetTrim3dStart ( int  ,
ON_3dPoint  
) const

◆ HasBrepForm()

bool ON_Brep::HasBrepForm ( ) const
overridevirtual

virtual ON_Geometry::HasBrepForm() override

Reimplemented from ON_Geometry.

◆ HasRegionTopology()

bool ON_Brep::HasRegionTopology ( ) const

◆ HasSlits() [1/3]

bool ON_Brep::HasSlits ( ) const

Check for slit trims and slit boundaries in each face.

Returns
true if any slits were found

◆ HasSlits() [2/3]

bool ON_Brep::HasSlits ( const ON_BrepFace F) const

Check for slit trims and slit boundaries in a face.

Returns
true if any slits were found

◆ HasSlits() [3/3]

bool ON_Brep::HasSlits ( const ON_BrepLoop L) const

Check for slit trims in a loop.

Returns
true if any slits were found

◆ HopAcrossEdge()

bool ON_Brep::HopAcrossEdge ( int &  ,
int &   
) const
protected

◆ Initialize()

void ON_Brep::Initialize ( )
protected

◆ Internal_AttachV5RegionTopologyAsUserData()

void ON_Brep::Internal_AttachV5RegionTopologyAsUserData ( ON_BinaryArchive archive) const
protected

◆ Internal_RegionTopologyPointer()

static class ON_BrepRegionTopology* ON_Brep::Internal_RegionTopologyPointer ( const ON_Brep brep,
bool  bValidateFaceCount 
)
staticprotected

◆ IsDuplicate()

bool ON_Brep::IsDuplicate ( const ON_Brep other,
double  tolerance = ON_ZERO_TOLERANCE 
) const

Does nothing. Will be deleted in next version.

◆ IsManifold()

bool ON_Brep::IsManifold ( bool *  pbIsOriented = nullptr,
bool *  pbHasBoundary = nullptr 
) const

Test brep to see if it is an oriented manifold.

Parameters
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.
Returns
true brep is a manifold fals brep is not a manifold
See also
ON_Brep::IsSolid

◆ IsPointInside()

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.

Parameters
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.
Returns
True if P is in, false if not. See parameter bStrictlyIn.

◆ IsSolid()

bool ON_Brep::IsSolid ( ) const

Test brep to see if it is a solid. (A "solid" is a closed oriented manifold.)

Returns
table true brep is a solid fals brep is not a solid
See also
ON_Brep::SolidOrientation, ON_Brep::IsManifold

◆ IsSurface()

bool ON_Brep::IsSurface ( ) const

◆ IsValid()

bool ON_Brep::IsValid ( class ON_TextLog text_log = nullptr) const
overridevirtual

Tests an object to see if its data members are correctly initialized.

Parameters
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
lowlevel debugging purposes by programmers and is not intended to be useful as a high level user interface tool.
Returns
table true object is valid false object is invalid, uninitialized, etc.

Reimplemented from ON_Object.

◆ IsValidEdge()

bool ON_Brep::IsValidEdge ( int  edge_index,
ON_TextLog text_log 
) const
protected

◆ IsValidEdgeGeometry()

bool ON_Brep::IsValidEdgeGeometry ( int  edge_index,
ON_TextLog text_log 
) const
protected

◆ IsValidEdgeTolerancesAndFlags()

bool ON_Brep::IsValidEdgeTolerancesAndFlags ( int  edge_index,
ON_TextLog text_log 
) const
protected

◆ IsValidEdgeTopology()

bool ON_Brep::IsValidEdgeTopology ( int  edge_index,
ON_TextLog text_log 
) const
protected

◆ IsValidFace()

bool ON_Brep::IsValidFace ( int  face_index,
ON_TextLog text_log 
) const
protected

◆ IsValidFaceGeometry()

bool ON_Brep::IsValidFaceGeometry ( int  face_index,
ON_TextLog text_log 
) const
protected

◆ IsValidFaceTolerancesAndFlags()

bool ON_Brep::IsValidFaceTolerancesAndFlags ( int  face_index,
ON_TextLog text_log 
) const
protected

◆ IsValidFaceTopology()

bool ON_Brep::IsValidFaceTopology ( int  face_index,
ON_TextLog text_log 
) const
protected

◆ IsValidForV2() [1/3]

bool ON_Brep::IsValidForV2 ( ) const

Tests brep to see if it is valid for saving in V2 3DM archives.

Returns
true if brep is valid for V2 3DM archives.

V2 breps could not have dangling curves.

◆ IsValidForV2() [2/3]

bool ON_Brep::IsValidForV2 ( const ON_BrepTrim ) const

◆ IsValidForV2() [3/3]

bool ON_Brep::IsValidForV2 ( const ON_BrepEdge ) const

◆ IsValidGeometry()

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.

Parameters
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
lowlevel debugging purposes by programmers and is not intended to be useful as a high level user interface tool.
Returns
table true brep geometry is valid false brep geometry is not valid

ON_Brep::IsValidTopology must be true before you can safely call ON_Brep::IsValidGeometry.

See also
ON_Brep::IsValid, ON_Brep::IsValidTopology, ON_Brep::IsValidTolerancesAndFlags

◆ IsValidLoop()

bool ON_Brep::IsValidLoop ( int  loop_index,
ON_TextLog text_log 
) const
protected

◆ IsValidLoopGeometry()

bool ON_Brep::IsValidLoopGeometry ( int  loop_index,
ON_TextLog text_log 
) const
protected

◆ IsValidLoopTolerancesAndFlags()

bool ON_Brep::IsValidLoopTolerancesAndFlags ( int  loop_index,
ON_TextLog text_log 
) const
protected

◆ IsValidLoopTopology()

bool ON_Brep::IsValidLoopTopology ( int  loop_index,
ON_TextLog text_log 
) const
protected

◆ IsValidTolerancesAndFlags()

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.

Parameters
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
lowlevel debugging purposes by programmers and is not intended to be useful as a high level user interface tool.
Returns
table true brep tolerance and flags are valid false brep tolerance and flags are not valid

ON_Brep::IsValidTopology and ON_Brep::IsValidGeometry must be true before you can safely call ON_Brep::IsValidTolerancesAndFlags.

See also
ON_Brep::IsValid, ON_Brep::IsValidTopology, ON_Brep::IsValidGeometry

◆ IsValidTopology()

bool ON_Brep::IsValidTopology ( ON_TextLog text_log = nullptr) const

Tests the brep to see if its topology information is valid.

Parameters
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
lowlevel debugging purposes by programmers and is not intended to be useful as a high level user interface tool.
Returns
table true brep topology is valid false brep topology is not valid

ON_Brep::IsValidTopology can be called at any time.

See also
ON_Brep::IsValid, ON_Brep::IsValidGeometry, ON_Brep::IsValidTolerancesAndFlags

◆ IsValidTrim()

bool ON_Brep::IsValidTrim ( int  trim_index,
ON_TextLog text_log 
) const
protected

helpers for validation checking

◆ IsValidTrimGeometry()

bool ON_Brep::IsValidTrimGeometry ( int  trim_index,
ON_TextLog text_log 
) const
protected

◆ IsValidTrimTolerancesAndFlags()

bool ON_Brep::IsValidTrimTolerancesAndFlags ( int  trim_index,
ON_TextLog text_log 
) const
protected

◆ IsValidTrimTopology()

bool ON_Brep::IsValidTrimTopology ( int  trim_index,
ON_TextLog text_log 
) const
protected

◆ IsValidVertex()

bool ON_Brep::IsValidVertex ( int  vertex_index,
ON_TextLog text_log 
) const
protected

◆ IsValidVertexGeometry()

bool ON_Brep::IsValidVertexGeometry ( int  vertex_index,
ON_TextLog text_log 
) const
protected

◆ IsValidVertexTolerancesAndFlags()

bool ON_Brep::IsValidVertexTolerancesAndFlags ( int  vertex_index,
ON_TextLog text_log 
) const
protected

◆ IsValidVertexTopology()

bool ON_Brep::IsValidVertexTopology ( int  vertex_index,
ON_TextLog text_log 
) const
protected

◆ LabelConnectedComponent()

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.

Parameters
face_index[in] index of face in component
label[in] value for m_*_user.i
Returns

Chases through trim lists of face edges to find adjacent faces. Does NOT check for vertex-vertex connections

◆ LabelConnectedComponents()

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.

Returns
number of 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.

See also
ON_Brep::GetConnectedComponents

◆ Loop() [1/2]

ON_BrepLoop* ON_Brep::Loop ( int  loop_index) const

Get loop from loop index or component index.

Parameters
loop_index[in] either an index into m_L[] or a component index of type brep_loop.
Returns
If the index is a valid loop index or a valid loop component index, then a pointer to the ON_BrepLoop is returned. Otherwise nullptr is returned. See Also ON_Brep::Component( const ON_BrepLoop& )

◆ Loop() [2/2]

ON_BrepLoop* ON_Brep::Loop ( ON_COMPONENT_INDEX  loop_index) const

◆ Loop2dCurve()

ON_Curve* ON_Brep::Loop2dCurve ( const ON_BrepLoop loop) const

Get a 3d curve that traces the entire loop

Parameters
loop[in] loop whose 2d curve should be duplicated
Returns
A pointer to a 2d ON_Curve. The caller must delete this curve.

◆ Loop3dCurve() [1/2]

ON_Curve* ON_Brep::Loop3dCurve ( const ON_BrepLoop loop,
bool  bRevCurveIfFaceRevIsTrue = false 
) const

Get a single 3d curve that traces the entire loop

Parameters
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.
Returns
A pointer to a 3d ON_Curve. The caller must delete this curve.

◆ Loop3dCurve() [2/2]

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

Parameters
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.
Returns
Number of curves appended to curve_list.

◆ LoopDirection()

int ON_Brep::LoopDirection ( const ON_BrepLoop ) const

◆ LoopIsSurfaceBoundary()

bool ON_Brep::LoopIsSurfaceBoundary ( int  ) const

◆ MakeTrimCurveNurb()

ON_NurbsCurve* ON_Brep::MakeTrimCurveNurb ( ON_BrepTrim T)

Convert the 2d curve of a trim to an ON_NurbsCurve

Parameters
T[in] brep trim
Returns
Pointer to m_C2[T.m_c2i] NOTE: After calling this, m_C2[T.m_c2i] will be a nurbs curve only referenced by T, with domain = T.m_t. Caller should not delete the returned curve since its memory is owned by the brep (this).

◆ MarkAggregateComponentStatusAsNotCurrent()

void ON_Brep::MarkAggregateComponentStatusAsNotCurrent ( ) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ MatchTrimEnds() [1/4]

bool ON_Brep::MatchTrimEnds ( ON_BrepTrim T0,
ON_BrepTrim T1 
)

Match the end of a trim to the start of the next trim.

Parameters
T0[in] brep trim
T1[in] brep trim that comes immediately after T0 in the same loop
Returns
true if either trim's 2d curve is changed

◆ MatchTrimEnds() [2/4]

bool ON_Brep::MatchTrimEnds ( int  trim_index)

Match the endpoints of a trim to the next and previous trim

Parameters
trim_index[in] index into m_T
Returns
true if any trim's 2d curve is changed

◆ MatchTrimEnds() [3/4]

bool ON_Brep::MatchTrimEnds ( ON_BrepLoop Loop)

Match the endpoints of all trims in a loop

Parameters
Loop[in] brep loop
Returns
true if any trim's 2d curve is changed

◆ MatchTrimEnds() [4/4]

bool ON_Brep::MatchTrimEnds ( )

Match the endpoints of all trims in a brep

Returns
true if any trim's 2d curve is changed

◆ MemoryRelocate()

void ON_Brep::MemoryRelocate ( )
overridevirtual

Override of virtual ON_Object::MemoryRelocate.

Reimplemented from ON_Object.

◆ MergeFaces() [1/2]

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.

Returns
id of merged face if faces were successfully merged. -1 if not merged.

Caller should call Compact() when done.

◆ MergeFaces() [2/2]

bool ON_Brep::MergeFaces ( )

Merge all possible faces that have the same m_si

Returns
true if any faces were successfully merged.

Caller should call Compact() when done.

◆ New() [1/2]

static ON_Brep* ON_Brep::New ( )
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).

Returns
Pointer to an ON_Brep. Destroy by calling delete.

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.

@verbatim
// bad - ON_Brep* pBrep = new ON_Brep();
ON_Brep* pBrep = ON_Brep::New(); // good
...
delete pBrep;
pBrep = nullptr;
@endverbatim

◆ New() [2/2]

static ON_Brep* ON_Brep::New ( const ON_Brep )
static

Use ON_Brep::New(const ON_Brep& src) instead of new ON_Brep(const ON_Brep& src).

Returns
Pointer to an ON_Brep. Destroy by calling delete.

See static ON_Brep* ON_Brep::New() for details.

◆ NewConeFace()

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.

Parameters
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.
Returns
A pointer to the new face or a nullptr if the new face could not be created.

◆ NewCurveOnFace()

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.

Parameters
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
Returns
new trim that represents the curve on surface

You should set the trim's ON_BrepTrim::m_tolerance and ON_BrepTrim::m_iso values.

◆ NewEdge() [1/2]

ON_BrepEdge& ON_Brep::NewEdge ( int  = -1)

◆ NewEdge() [2/2]

ON_BrepEdge& ON_Brep::NewEdge ( ON_BrepVertex ,
ON_BrepVertex ,
int  = -1,
const ON_Interval = nullptr,
double  edge_tolerance = ON_UNSET_VALUE 
)

◆ NewFace() [1/3]

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.

Parameters
si[in] index of surface in brep's m_S[] array
Returns
Reference to new face.

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.

See ON_BrepBox and ON_BrepSphere source code.
See also
ON_Brep::AddSurface

◆ NewFace() [2/3]

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.

Parameters
surface[in] surface is copied.
Returns
Pointer to new face.

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.

See also
ON_Brep::JoinEdges, ON_Brep::AddSurface

◆ NewFace() [3/3]

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.

Parameters
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.
Returns
Pointer to the new face or nullptr if input is not valid. If null is returned, then the caller must delete pSurace unless it was previously added to the 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.

See ON_BrepBox and ON_BrepSphere source code.
See also
ON_Brep::AddSurface, ON_Brep::AddFace( int si ), ON_Brep::Create( ON_Surface*& )

◆ NewLoop() [1/2]

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.

Returns
New boundary loop.

◆ NewLoop() [2/2]

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.

Returns
New loop that needs to be filled in.

◆ NewOuterLoop() [1/2]

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.

Parameters
face_index[in] index of face that needs an outer boundary that runs along the sides of its surface.
Returns
New outer boundary loop that is complete.

◆ NewOuterLoop() [2/2]

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.

Parameters
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.
Returns
Pointer to the new loop or nullptr if input is not valid.

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.

See also
ON_Brep::NewFace

◆ NewPlanarFaceLoop()

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.

Parameters
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.
Returns
true if successful. The new loop will be brep.m_L.Last().

◆ NewPointOnFace()

ON_BrepVertex& ON_Brep::NewPointOnFace ( ON_BrepFace face,
double  s,
double  t 
)

Adds a new point on face to the brep.

Parameters
face[in] face that vertex lies on s,t - [in] surface parameters
Returns
new vertex that represents the point on face.

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.

◆ NewRuledFace()

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.

Parameters
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.
Returns
A pointer to the new face or a nullptr if the new face could not be created.

◆ NewSingularTrim()

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.

Parameters
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
Returns
new trim
See also
ON_Brep::NewTrim

◆ NewTrim() [1/4]

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.

Parameters
c2i[in] index of 2d trimming curve
Returns
new trim

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.

int c2i = brep->AddTrimCurve( p2dCurve );
ON_BrepTrim& trim = NewTrim( edge, bRev3d, loop, c2i );
trim.m_ei = ...;
trim.m_li = ...;
trim.m_tolerance[0] = ...;
trim.m_tolerance[1] = ...;
trim.m_type = ...;
trim.m_iso = ...;
See also
ON_Brep::SetTrimTypeFlags, ON_Brep::SetTrimIsoFlags, ON_Brep::NewSingularTrim, ON_Brep::NewPointOnFace, ON_Brep::NewCurveOnFace

◆ NewTrim() [2/4]

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.

Parameters
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
Returns
new trim

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.

int c2i = brep->AddTrimCurve( p2dCurve );
ON_BrepTrim& trim = NewTrim( edge, bRev3d, loop, c2i );
trim.m_ei = ...;
trim.m_tolerance[0] = ...;
trim.m_tolerance[1] = ...;
trim.m_type = ...;
trim.m_iso = ...;
See also
ON_Brep::SetTrimTypeFlags, ON_Brep::SetTrimIsoFlags, ON_Brep::NewSingularTrim, ON_Brep::NewPointOnFace, ON_Brep::NewCurveOnFace

◆ NewTrim() [3/4]

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.

Parameters
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
Returns
new trim

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.

int c2i = brep->AddTrimCurve( p2dCurve );
ON_BrepTrim& trim = NewTrim( edge, bRev3d, c2i );
trim.m_li = ...;
trim.m_tolerance[0] = ...;
trim.m_tolerance[1] = ...;
trim.m_type = ...;
trim.m_iso = ...;
See also
ON_Brep::SetTrimTypeFlags, ON_Brep::SetTrimIsoFlags, ON_Brep::NewSingularTrim, ON_Brep::NewPointOnFace, ON_Brep::NewCurveOnFace

◆ NewTrim() [4/4]

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.

Parameters
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
Returns
new trim

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.

int c2i = brep->AddTrimCurve( p2dCurve );
ON_BrepTrim& trim = brep->NewTrim( edge, bRev3d, loop, c2i );
trim.m_tolerance[0] = ...;
trim.m_tolerance[1] = ...;
See also
ON_Brep::SetTrimTypeFlags, ON_Brep::SetTrimIsoFlags, ON_Brep::NewSingularTrim, ON_Brep::NewPointOnFace, ON_Brep::NewCurveOnFace

◆ NewVertex() [1/2]

ON_BrepVertex& ON_Brep::NewVertex ( )

◆ NewVertex() [2/2]

ON_BrepVertex& ON_Brep::NewVertex ( ON_3dPoint  vertex_point,
double  vertex_tolerance = ON_UNSET_VALUE 
)

◆ NextEdge()

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.

Parameters
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
Returns
edge index of the next edge or -1 if there is only one edge that begins or 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.

See also
ON_Brep::NextEdge

◆ NextNonsingularTrim()

int ON_Brep::NextNonsingularTrim ( int  ) const

◆ NextTrim()

int ON_Brep::NextTrim ( int  ) const

◆ ObjectType()

ON::object_type ON_Brep::ObjectType ( ) const
overridevirtual

virtual ON_Objet::ObjectType() override

Reimplemented from ON_Object.

◆ operator=()

ON_Brep& ON_Brep::operator= ( const ON_Brep )

◆ PrevEdge()

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.

Parameters
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
Returns
edge index of the previous edge or -1 if there is only one edge that begins or 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.

See also
ON_Brep::NextEdge

◆ PrevNonsingularTrim()

int ON_Brep::PrevNonsingularTrim ( int  ) const

Same as NextTrim and PrevTrim, but skips over trims with type singular.

◆ PrevTrim()

int ON_Brep::PrevTrim ( int  ) const

Navigation Interface.

for moving around loops - returns trim index of prev/next trim in loop

◆ Read()

bool ON_Brep::Read ( ON_BinaryArchive )
overridevirtual

virtual ON_Objet::Read() override

Reimplemented from ON_Object.

◆ Read100_BrepCurve()

ON_Curve* ON_Brep::Read100_BrepCurve ( ON_BinaryArchive ) const
protected

◆ Read100_BrepSurface()

ON_Surface* ON_Brep::Read100_BrepSurface ( ON_BinaryArchive ) const
protected

◆ ReadOld100()

bool ON_Brep::ReadOld100 ( ON_BinaryArchive )
protected

read helpers to support various versions

◆ ReadOld101()

bool ON_Brep::ReadOld101 ( ON_BinaryArchive )
protected

◆ ReadOld200()

bool ON_Brep::ReadOld200 ( ON_BinaryArchive ,
int   
)
protected

◆ ReadV1_LegacyFaceStuff()

bool ON_Brep::ReadV1_LegacyFaceStuff ( ON_BinaryArchive )
protected

◆ ReadV1_LegacyLoop()

bool ON_Brep::ReadV1_LegacyLoop ( ON_BinaryArchive ,
ON_BrepFace  
)
protected

◆ ReadV1_LegacyLoopStuff()

bool ON_Brep::ReadV1_LegacyLoopStuff ( ON_BinaryArchive ,
ON_BrepFace  
)
protected

◆ ReadV1_LegacyShellStuff()

bool ON_Brep::ReadV1_LegacyShellStuff ( ON_BinaryArchive )
protected

◆ ReadV1_LegacyTrim()

bool ON_Brep::ReadV1_LegacyTrim ( ON_BinaryArchive ,
ON_BrepFace ,
ON_BrepLoop  
)
protected

◆ ReadV1_LegacyTrimStuff()

bool ON_Brep::ReadV1_LegacyTrimStuff ( ON_BinaryArchive ,
ON_BrepFace ,
ON_BrepLoop  
)
protected

helpers for reading legacy v1 trimmed surfaces and breps

◆ RegionTopology()

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().

◆ RemoveNesting()

bool ON_Brep::RemoveNesting ( bool  bExtractSingleSegments,
bool  bEdges = true,
bool  bTrimCurves = true 
)

Removes nested polycurves from the m_C2[] and m_C3[] arrays.

Parameters
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.
Returns
True if any nesting was removed and false if no nesting was removed.

◆ RemoveSlits() [1/3]

bool ON_Brep::RemoveSlits ( )

remove slit trims and slit boundaries from each face.

Returns
true if any slits were removed

Caller should call Compact() afterwards.

◆ RemoveSlits() [2/3]

bool ON_Brep::RemoveSlits ( ON_BrepFace F)

remove slit trims and slit boundaries from a face.

Parameters
F[in] brep face
Returns
true if any slits were removed

Caller should call Compact() when done.

◆ RemoveSlits() [3/3]

bool ON_Brep::RemoveSlits ( ON_BrepLoop L)

remove slit trims from a loop.

Parameters
L[in] brep loop
Returns
true if any slits were removed

Caller should call Compact() when done. If all trims are removed, the loop will be marked as deleted.

◆ RemoveWireEdges()

int ON_Brep::RemoveWireEdges ( bool  bDeleteVertices = true)

Remove edges that are not connected to a face.

Parameters
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.
Returns
Number of edges that were removed.

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.

See also
ON_Brep::RemoveWireVertices

◆ RemoveWireVertices()

int ON_Brep::RemoveWireVertices ( )

Remove vertices that are not connected to an edge.

Returns
Number of vertices that were deleted.

After you finish cleaning up the brep, you need to call ON_Brep::Compact() to remove deleted vertices from the m_V[] array.

See also
ON_Brep::RemoveWireEdges

◆ Set_user()

void ON_Brep::Set_user ( ON_U  u) const

"Expert" Interface

◆ SetComponentStates()

unsigned int ON_Brep::SetComponentStates ( ON_COMPONENT_INDEX  component_index,
ON_ComponentStatus  states_to_set 
) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ SetComponentStatus()

unsigned int ON_Brep::SetComponentStatus ( ON_COMPONENT_INDEX  component_index,
ON_ComponentStatus  status_to_copy 
) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ SetEdgeCurve()

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.

Parameters
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().
Returns
true if successful.

◆ SetEdgeDomain()

bool ON_Brep::SetEdgeDomain ( int  ,
const ON_Interval  
)

◆ SetEdgeTolerance()

virtual bool ON_Brep::SetEdgeTolerance ( ON_BrepEdge edge,
bool  bLazy = false 
) const
virtual

◆ SetEdgeTolerances()

bool ON_Brep::SetEdgeTolerances ( bool  bLazy = false)

Set the brep's edge tolerances.

Parameters
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.
Returns
true if successful.
See also
ON_Brep::SetVertexTolerance, ON_Brep::SetTrimTolerance, ON_Brep::SetEdgeTolerance, ON_Brep::SetVertexTolerances, ON_Brep::SetTrimTolerances, ON_Brep::SetEdgeTolerances, ON_Brep::SetTolerancesAndFlags

◆ SetEdgeVertex()

bool ON_Brep::SetEdgeVertex ( const int  ,
const int  ,
const int   
)
protected

helpers to create and set vertices

◆ SetLoopVertices()

void ON_Brep::SetLoopVertices ( const int  )
protected

◆ SetTolerancesBoxesAndFlags()

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

Parameters
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
See also
ON_Brep::SetVertexTolerance, ON_Brep::SetEdgeTolerance, ON_Brep::SetTrimTolerance, ON_Brep::SetTrimTypeFlags, ON_Brep::SetTrimIsoFlags, ON_Brep::ComputeLoopType, ON_Brep::SetTrimBoundingBox, ON_Brep::SetTrimBoundingBoxes

◆ SetTolsFromLegacyValues()

void ON_Brep::SetTolsFromLegacyValues ( )
protected

◆ SetTrimBoundingBox()

virtual bool ON_Brep::SetTrimBoundingBox ( ON_BrepTrim trim,
bool  bLazy = false 
)
virtual

Set the trim parameter space bounding box (trim.m_pbox).

Parameters
trim[in]
bLazy[in] if true and trim.m_pbox is valid, then the box is not set.
Returns
true if trim ends up with a valid bounding box.

◆ SetTrimBoundingBoxes() [1/3]

virtual bool ON_Brep::SetTrimBoundingBoxes ( ON_BrepLoop loop,
bool  bLazy = false 
)
virtual

Set the loop parameter space bounding box (loop.m_pbox).

Parameters
loop[in]
bLazy[in] if true and loop trim trim.m_pbox is valid, then that trim.m_pbox is not recalculated.
Returns
true if loop ends up with a valid bounding box.

◆ SetTrimBoundingBoxes() [2/3]

virtual bool ON_Brep::SetTrimBoundingBoxes ( ON_BrepFace face,
bool  bLazy = false 
)
virtual

Set the loop and trim parameter space bounding boxes for every loop and trim in the face

Parameters
face[in]
bLazy[in] if true and trim trim.m_pbox is valid, then that trim.m_pbox is not recalculated.
Returns
true if all the face's loop and trim parameter space bounding boxes are valid.

◆ SetTrimBoundingBoxes() [3/3]

virtual bool ON_Brep::SetTrimBoundingBoxes ( bool  bLazy = false)
virtual

Set the loop and trim parameter space bounding boxes for every loop and trim in the brep.

Parameters
bLazy[in] if true and trim trim.m_pbox is valid, then that trim.m_pbox is not recalculated.
Returns
true if all the loop and trim parameter space bounding boxes are valid.

◆ SetTrimCurve()

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.

Parameters
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().
Returns
true if successful.

◆ SetTrimDomain()

bool ON_Brep::SetTrimDomain ( int  ,
const ON_Interval  
)

◆ SetTrimIsoFlag() [1/2]

void ON_Brep::SetTrimIsoFlag ( int  ,
double  [6] 
)
protected

helpers to set ON_BrepTrim::m_iso flag

◆ SetTrimIsoFlag() [2/2]

void ON_Brep::SetTrimIsoFlag ( int  )
protected

◆ SetTrimIsoFlags() [1/4]

bool ON_Brep::SetTrimIsoFlags ( )

◆ SetTrimIsoFlags() [2/4]

bool ON_Brep::SetTrimIsoFlags ( ON_BrepFace )

◆ SetTrimIsoFlags() [3/4]

bool ON_Brep::SetTrimIsoFlags ( ON_BrepLoop )

◆ SetTrimIsoFlags() [4/4]

bool ON_Brep::SetTrimIsoFlags ( ON_BrepTrim )

◆ SetTrimStartVertex()

bool ON_Brep::SetTrimStartVertex ( const int  ,
const int   
)
protected

◆ SetTrimTolerance()

virtual bool ON_Brep::SetTrimTolerance ( ON_BrepTrim trim,
bool  bLazy = false 
) const
virtual

◆ SetTrimTolerances()

bool ON_Brep::SetTrimTolerances ( bool  bLazy = false)

Set the brep's trim tolerances.

Parameters
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.
Returns
true if successful.
See also
ON_Brep::SetVertexTolerance, ON_Brep::SetTrimTolerance, ON_Brep::SetEdgeTolerance, ON_Brep::SetVertexTolerances, ON_Brep::SetTrimTolerances, ON_Brep::SetEdgeTolerances, ON_Brep::SetTolerancesAndFlags

◆ SetTrimTypeFlags() [1/4]

bool ON_Brep::SetTrimTypeFlags ( bool  bLazy = false)

◆ SetTrimTypeFlags() [2/4]

bool ON_Brep::SetTrimTypeFlags ( ON_BrepFace ,
bool  bLazy = false 
)

◆ SetTrimTypeFlags() [3/4]

bool ON_Brep::SetTrimTypeFlags ( ON_BrepLoop ,
bool  bLazy = false 
)

◆ SetTrimTypeFlags() [4/4]

bool ON_Brep::SetTrimTypeFlags ( ON_BrepTrim ,
bool  bLazy = false 
)

◆ SetVertexTolerance()

bool ON_Brep::SetVertexTolerance ( ON_BrepVertex vertex,
bool  bLazy = false 
) const

◆ SetVertexTolerances()

bool ON_Brep::SetVertexTolerances ( bool  bLazy = false)

Set the brep's vertex tolerances.

Parameters
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.
Returns
true if successful.
See also
ON_Brep::SetVertexTolerance, ON_Brep::SetTrimTolerance, ON_Brep::SetEdgeTolerance, ON_Brep::SetVertexTolerances, ON_Brep::SetTrimTolerances, ON_Brep::SetEdgeTolerances, ON_Brep::SetTolerancesAndFlags

◆ SetVertices()

void ON_Brep::SetVertices ( void  )

◆ ShrinkSurface()

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.

Parameters
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.
Returns
table true successful false failure

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.

See also
ON_Brep::ShrinkSurfaces, ON_Brep::CullUnusedSurfaces

◆ ShrinkSurfaces()

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.

Returns
table true successful false failure

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.

See also
ON_Brep::ShrinkSurface, ON_Brep::CullUnusedSurfaces

◆ SizeOf()

unsigned int ON_Brep::SizeOf ( ) const
overridevirtual

virtual ON_Object::SizeOf override

Reimplemented from ON_Object.

◆ SolidOrientation()

virtual int ON_Brep::SolidOrientation ( ) const
virtual

Determine orientation of a brep.

Returns
table +2 brep is a solid but orientation cannot be computed +1 brep is a solid with outward facing normals -1 brep is a solid with inward facing normals 0 brep is not a solid

The base class implementation returns 2 or 0. This function is overridden in the Rhino SDK and returns +1, -1, or 0.

See also
ON_Brep::IsSolid

◆ SortFaceLoops()

bool ON_Brep::SortFaceLoops ( ON_BrepFace face) const

Sort the face.m_li[] array by loop type (outer, inner, slit, crvonsrf, ptonsrf)

Parameters
face[in/out] face whose m_li[] array should be sorted.
Returns
table true success false failure - no loops or loops with unset loop.m_type
See also
ON_Brep::ComputeLoopType, ON_Brep::LoopDirection

◆ Standardize()

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.

See also
ON_Brep::StandardizeTrimCurves, ON_Brep::StandardizeEdgeCurves, ON_Brep::StandardizeFaceSurface, ON_Brep::Compact

◆ StandardizeEdgeCurve() [1/2]

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.

Parameters
edge_index[in] index of edge to standardize.
bAdjustEnds[in] if true, move edge curve endpoints to vertices
See also
ON_Brep::StandardizeEdgeCurves, ON_Brep::Standardize

◆ StandardizeEdgeCurve() [2/2]

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.

Parameters
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.
See also
ON_Brep::StandardizeEdgeCurves, ON_Brep::Standardize

◆ StandardizeEdgeCurves()

void ON_Brep::StandardizeEdgeCurves ( bool  bAdjustEnds)

Standardize all edges in the brep.

Parameters
bAdjustEnds[in] if true, move edge curve endpoints to vertices
See also
ON_Brep::StandardizeEdgeCurve, ON_Brep::Standardize

◆ StandardizeFaceSurface()

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.

Parameters
face_index[in] index of face to standardize.
See also
ON_Brep::StardardizeFaceSurfaces, ON_Brep::Standardize

◆ StandardizeFaceSurfaces()

void ON_Brep::StandardizeFaceSurfaces ( )

Standardize all faces in the brep.

See also
ON_Brep::StandardizeFaceSurface, ON_Brep::Standardize

◆ StandardizeTrimCurve()

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.

Parameters
trim_index[in] index of trim to standardize.
See also
ON_Brep::StandardizeTrimCurves, ON_Brep::Standardize

◆ StandardizeTrimCurves()

void ON_Brep::StandardizeTrimCurves ( )

Standardize all trims in the brep.

See also
ON_Brep::StandardizeTrimCurve, ON_Brep::Standardize

◆ SubBrep()

ON_Brep* ON_Brep::SubBrep ( int  subfi_count,
const int *  sub_fi,
ON_Brep sub_brep = 0 
) const

Copy a subset of this brep.

Parameters
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.
Returns
If the input is valid, a pointer to the subbrep is returned. If the input is not valid, null is returned. The faces in in the subbrep's m_F array are in the same order as they were specified in sub_fi[].

◆ SurfaceUseCount()

int ON_Brep::SurfaceUseCount ( int  surface_index,
int  max_count = 0 
) const

Query Interface.

Determine how many brep faces reference m_S[surface_index].

Parameters
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.
Returns
Number of brep faces that reference the surface.

◆ SwapCoordinates()

bool ON_Brep::SwapCoordinates ( int  ,
int   
)
overridevirtual

virtual ON_Geometry::SwapCoordinates() override

Reimplemented from ON_Geometry.

◆ SwapLoopParameters()

bool ON_Brep::SwapLoopParameters ( int  )
protected

helpers for SwapFaceParameters()

◆ SwapTrimParameters()

bool ON_Brep::SwapTrimParameters ( int  )
protected

◆ Transform()

bool ON_Brep::Transform ( const ON_Xform )
overridevirtual

virtual ON_Geometry::Transform() override

Reimplemented from ON_Geometry.

◆ Trim() [1/2]

ON_BrepTrim* ON_Brep::Trim ( int  trim_index) const

Get trim from trim index or component index.

Parameters
trim_index[in] either an index into m_T[] or a component index of type brep_trim.
Returns
If the index is a valid trim index or a valid trim component index, then a pointer to the ON_BrepTrim is returned. Otherwise nullptr is returned. See Also ON_Brep::Component( const ON_BrepTrim& )

◆ Trim() [2/2]

ON_BrepTrim* ON_Brep::Trim ( ON_COMPONENT_INDEX  trim_index) const

◆ TrimCurveUseCount()

int ON_Brep::TrimCurveUseCount ( int  c2_index,
int  max_count = 0 
) const

Determine how many brep trims reference m_C2[c2_index].

Parameters
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.
Returns
Number of brep trims that reference the 2d curve.

◆ TrimType()

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.

Parameters
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.
Returns
Type of trim.

The trim must be connected to a valid loop.

See also
ON_Brep::SetTrimTypeFlags

◆ Vertex() [1/2]

ON_BrepVertex* ON_Brep::Vertex ( int  vertex_index) const

Get vertex from trim index or component index.

Parameters
vertex_index[in] either an index into m_V[] or a component index of type brep_vertex.
Returns
If the index is a valid vertex index or a valid vertex component index, then a pointer to the ON_BrepVertex is returned. Otherwise nullptr is returned. See Also ON_Brep::Component( const ON_BrepVertex& )

◆ Vertex() [2/2]

ON_BrepVertex* ON_Brep::Vertex ( ON_COMPONENT_INDEX  vertex_index) const

◆ Write()

bool ON_Brep::Write ( ON_BinaryArchive ) const
overridevirtual

virtual ON_Objet::Write() override

Reimplemented from ON_Object.

Friends And Related Function Documentation

◆ ON_BinaryArchive::ReadV1_TCODE_LEGACY_FAC

◆ ON_BinaryArchive::ReadV1_TCODE_LEGACY_SHL

◆ ON_BrepFace

friend class ON_BrepFace
friend

◆ ON_BrepFaceSide

friend class ON_BrepFaceSide
friend

◆ ON_BrepRegion

friend class ON_BrepRegion
friend

◆ ON_V5_BrepRegionTopologyUserData

friend class ON_V5_BrepRegionTopologyUserData
friend

Member Data Documentation

◆ m_aggregate_status

ON_AggregateComponentStatus ON_Brep::m_aggregate_status
mutableprotected

◆ m_bbox

ON_BoundingBox ON_Brep::m_bbox
protected

◆ m_brep_user

ON_U ON_Brep::m_brep_user
mutable

◆ m_C2

ON_CurveArray ON_Brep::m_C2

◆ m_C3

ON_CurveArray ON_Brep::m_C3

◆ m_E

ON_BrepEdgeArray ON_Brep::m_E

◆ m_F

ON_BrepFaceArray ON_Brep::m_F

◆ m_is_solid

int ON_Brep::m_is_solid = 0
protected

◆ m_L

ON_BrepLoopArray ON_Brep::m_L

◆ m_region_topology

class ON_BrepRegionTopology* ON_Brep::m_region_topology = nullptr
protected

◆ m_S

ON_SurfaceArray ON_Brep::m_S

◆ m_T

ON_BrepTrimArray ON_Brep::m_T

◆ m_V

ON_BrepVertexArray ON_Brep::m_V