Rhino C++ API  8.5
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
ON_Brep Class Reference

#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 *)
 3d curve used by ON_BrepEdge More...
 
int AddSurface (ON_Surface *)
 3d surface used by ON_BrepFace More...
 
int AddTrimCurve (ON_Curve *)
 Creation Interface. More...
 
ON_AggregateComponentStatus AggregateComponentStatus () const override
 virtual More...
 
void Append (const ON_Brep &)
 
bool AreaMassProperties (ON_MassProperties &mp, bool bArea=true, bool bFirstMoments=true, bool bSecondMoments=true, bool bProductMoments=true, double rel_tol=1.0e-6, double abs_tol=1.0e-6) const
 
const ON_GeometryBrepComponent (ON_COMPONENT_INDEX ci) const
 
ON_BrepBrepForm (ON_Brep *brep=nullptr) const override
 
bool ChangeVertex (int old_vi, int new_vi, bool bClearTolerances)
 
void Clear_edge_user_i () const
 zero all brep's m_edge_user values More...
 
void Clear_edge_user_i (int) const
 zero all brep's m_edge_user values More...
 
void Clear_face_user_i () const
 zero all brep's m_face_user values More...
 
void Clear_loop_user_i () const
 zero all brep's m_loop_user values More...
 
void Clear_trim_user_i () const
 zero all brep's m_trim_user values More...
 
void Clear_user_i () const
 zero all brep's m_*_user values More...
 
void Clear_vertex_user_i () const
 zero all brep's m_vertex_user values More...
 
void ClearBoundingBox () override
 virtual ON_Geometry::ClearBoundingBox() override More...
 
unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const override
 virtual More...
 
unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const override
 virtual More...
 
unsigned int ClearPerFaceColors () const
 
unsigned int ClearPerFaceMaterialChannelIndices ()
 
bool CloseTrimGap (ON_BrepTrim &trim0, ON_BrepTrim &trim1)
 
bool CollapseEdge (int edge_index, bool bCloseTrimGap=true, int vertex_index=-1)
 
bool CombineCoincidentEdges (ON_BrepEdge &, ON_BrepEdge &)
 moves information to first edge and deletes second More...
 
bool CombineCoincidentVertices (ON_BrepVertex &, ON_BrepVertex &)
 moves information to first vertex and deletes second More...
 
ON_BrepEdgeCombineContiguousEdges (int edge_index0, int edge_iindex1, double angle_tolerance_radians=ON_PI/180.0)
 
bool Compact ()
 
ON_BrepLoop::TYPE ComputeLoopType (const ON_BrepLoop &) const
 
bool Create (ON_NurbsSurface *&pNurbsSurface)
 
bool Create (ON_PlaneSurface *&pPlaneSurface)
 
bool Create (ON_RevSurface *&pRevSurface)
 
bool Create (ON_SumSurface *&pSumSurface)
 
bool Create (ON_Surface *&pSurface)
 
int CreateMesh (const ON_MeshParameters &mp, ON_SimpleArray< ON_Mesh * > &mesh_list) const
 
bool CullUnused2dCurves ()
 culls 3d curves not referenced by an edge More...
 
bool CullUnused3dCurves ()
 culls 2d curves not referenced by a trim More...
 
bool CullUnusedEdges ()
 culls edges with m_edge_index == -1 More...
 
bool CullUnusedFaces ()
 culls faces with m_face_index == -1 More...
 
bool CullUnusedLoops ()
 culls loops with m_loop_index == -1 More...
 
bool CullUnusedSurfaces ()
 culls surfaces not referenced by a face More...
 
bool CullUnusedTrims ()
 culls trims with m_trim_index == -1 More...
 
bool CullUnusedVertices ()
 culls vertices with m_vertex_index == -1 More...
 
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)
 pass true to delete vertices used only by edge More...
 
void DeleteFace (ON_BrepFace &face, bool bDeleteFaceEdges)
 pass true to delete edges and vertices used only by face More...
 
void DeleteLoop (ON_BrepLoop &loop, bool bDeleteLoopEdges)
 pass true to delete edges and vertices used only by trim More...
 
void DeleteSurface (int s_index)
 
void DeleteTrim (ON_BrepTrim &trim, bool bDeleteTrimEdges)
 pass true to delete edges and vertices used only by trim More...
 
void DeleteVertex (ON_BrepVertex &vertex)
 
void Destroy ()
 construction/destruction helpers More...
 
void DestroyMesh (ON::mesh_type mesh_type)
 
void DestroyMesh (ON::mesh_type mesh_type, bool bDeleteMesh)
 
void DestroyRegionTopology ()
 
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)
 
void Dump (ON_TextLog &) const override
 virtual ON_Objet::Dump() override More...
 
ON_BrepDuplicateFace (int face_index, bool bDuplicateMeshes) const
 
ON_BrepDuplicateFaces (int face_count, const int *face_index, bool bDuplicateMeshes) const
 
ON_BrepEdgeEdge (int edge_index) const
 
ON_BrepEdgeEdge (ON_COMPONENT_INDEX edge_index) const
 
int EdgeCurveUseCount (int c3_index, int max_count=0) const
 
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)
 
ON_BrepFaceFace (int face_index) const
 
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 &)
 reverses orientation of trimming loop More...
 
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
 
bool GetEdgeParameter (int trim_index, double trim_t, double *edge_t, bool bOkToBuildTrimPline=true) const
 
int GetMesh (ON::mesh_type mesh_type, ON_SimpleArray< const ON_Mesh * > &meshes) const
 
bool GetSilhouette (const ON_SilhouetteParameters parameters, const ON_PlaneEquation *clipping_planes, size_t clipping_plane_count, ON_ClassArray< ON_SIL_EVENT > &silhouettes, ON_ProgressReporter *progress, ON_Terminator *terminator) const
 
int GetTangentConnectedComponents (ON_SimpleArray< ON_Brep * > &components, double angle_tol, bool bDuplicateMeshes) const
 
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 GetTrimParameter (int trim_index, double edge_t, double *trim_t, bool bOkToBuildTrimPline=true) const
 
bool HasBrepForm () const override
 virtual ON_Geometry::HasBrepForm() override More...
 
bool HasPerFaceColors () const
 
bool HasPerFaceMaterialChannelIndices () const
 
bool HasRegionTopology () const
 
bool HasSlits () const
 
bool HasSlits (const ON_BrepFace &F) const
 
bool HasSlits (const ON_BrepLoop &L) const
 
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
 
bool IsDeformable () const override
 virtual ON_Geometry::IsDeformable() override More...
 
bool IsDuplicate (const ON_Brep &other, double tolerance=ON_ZERO_TOLERANCE) const
 
bool IsManifold (bool *pbIsOriented=nullptr, bool *pbHasBoundary=nullptr) const
 
bool IsMorphable () const override
 virtual ON_Geometry override More...
 
bool IsPointInside (ON_3dPoint P, double tolerance, bool bStrictlyInside) const
 
bool IsSolid () const
 
bool IsSurface () const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
bool IsValidForV2 () const
 
bool IsValidForV2 (const ON_BrepEdge &) const
 
bool IsValidForV2 (const ON_BrepTrim &) const
 
bool IsValidGeometry (ON_TextLog *text_log=nullptr) const
 
bool IsValidTolerancesAndFlags (ON_TextLog *text_log=nullptr) const
 
bool IsValidTopology (ON_TextLog *text_log=nullptr) const
 
bool JoinEdges (ON_BrepEdge &edge, ON_BrepEdge &other_edge, double join_tolerance, bool bCheckFaceOrientaion=true)
 
void LabelConnectedComponent (int face_index, int label) const
 
int LabelConnectedComponents () const
 
void LabelTangentConnectedComponent (int face_index, double atol, int label) const
 
int LabelTangentConnectedComponents (double angle_tol) const
 
ON_BrepLoopLoop (int loop_index) const
 
ON_BrepLoopLoop (ON_COMPONENT_INDEX loop_index) const
 
ON_CurveLoop2dCurve (const ON_BrepLoop &loop) const
 
ON_CurveLoop3dCurve (const ON_BrepLoop &loop, bool bRevCurveIfFaceRevIsTrue=false) const
 
int Loop3dCurve (const ON_BrepLoop &loop, ON_SimpleArray< ON_Curve * > &curve_list, bool bRevCurveIfFaceRevIsTrue=false) const
 
int LoopDirection (const ON_BrepLoop &) const
 
bool LoopIsSurfaceBoundary (int) const
 parameter space. More...
 
bool MakeDeformable () override
 virtual ON_Geometry::MakeDeformable() override More...
 
ON_NurbsCurveMakeTrimCurveNurb (ON_BrepTrim &T)
 
bool MakeValidForV2 ()
 
void MarkAggregateComponentStatusAsNotCurrent () const override
 virtual More...
 
bool MatchTrimEnds ()
 
bool MatchTrimEnds (int trim_index)
 
bool MatchTrimEnds (ON_BrepLoop &Loop)
 
bool MatchTrimEnds (ON_BrepTrim &T0, ON_BrepTrim &T1)
 
void MemoryRelocate () override
 Override of virtual ON_Object::MemoryRelocate. More...
 
bool MergeFaces ()
 
int MergeFaces (int fid0, int fid1)
 
bool Morph (const ON_SpaceMorph &morph) override
 virtual ON_Geometry override More...
 
ON_BrepFaceNewConeFace (const ON_BrepVertex &vertex, const ON_BrepEdge &edge, bool bRevEdge)
 
ON_BrepTrimNewCurveOnFace (ON_BrepFace &face, ON_BrepEdge &edge, bool bRev3d=false, int c2i=-1)
 
ON_BrepEdgeNewEdge (int=-1)
 
ON_BrepEdgeNewEdge (ON_BrepVertex &, ON_BrepVertex &, int=-1, const ON_Interval *=nullptr, double edge_tolerance=ON_UNSET_VALUE)
 
ON_BrepFaceNewFace (const ON_Surface &surface)
 
ON_BrepFaceNewFace (int si=-1)
 
ON_BrepFaceNewFace (ON_Surface *pSurface, int vid[4], int eid[4], bool bRev3d[4])
 
ON_BrepLoopNewLoop (ON_BrepLoop::TYPE loop_type, ON_BrepFace &face)
 
ON_BrepLoopNewLoop (ON_BrepLoop::TYPE)
 
ON_BrepLoopNewOuterLoop (int face_index)
 
ON_BrepLoopNewOuterLoop (int face_index, int vid[4], int eid[4], bool bRev3d[4])
 
bool NewPlanarFaceLoop (int face_index, ON_BrepLoop::TYPE loop_type, ON_SimpleArray< ON_Curve * > &boundary, bool bDuplicateCurves=true)
 
ON_BrepVertexNewPointOnFace (ON_BrepFace &face, double s, double t)
 
ON_BrepFaceNewRuledFace (const ON_BrepEdge &edgeA, bool bRevEdgeA, const ON_BrepEdge &edgeB, bool bRevEdgeB)
 
ON_BrepTrimNewSingularTrim (const ON_BrepVertex &vertex, ON_BrepLoop &loop, ON_Surface::ISO iso, int c2i=-1)
 
ON_BrepTrimNewTrim (bool bRev3d, ON_BrepLoop &loop, int c2i=-1)
 
ON_BrepTrimNewTrim (int c2i=-1)
 
ON_BrepTrimNewTrim (ON_BrepEdge &edge, bool bRev3d, int c2i=-1)
 
ON_BrepTrimNewTrim (ON_BrepEdge &edge, bool bRev3d, ON_BrepLoop &loop, int c2i=-1)
 
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
 
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 &)
 
unsigned int PackFaces (bool from_subd=true)
 
int PrevEdge (int current_edge_index, int endi, int *prev_endi=nullptr) const
 
int PrevNonsingularTrim (int) const
 Same as NextTrim and PrevTrim, but skips over trims with type singular. More...
 
int PrevTrim (int) const
 Navigation Interface. More...
 
ON__UINT64 ProxyBrepSubDRuntimeSerialNumber () const
 
bool Read (ON_BinaryArchive &) override
 virtual ON_Objet::Read() override More...
 
bool RebuildEdges (ON_BrepFace &face, double tolerance, bool bRebuildSharedEdges, bool bRebuildVertices)
 
void RebuildTrimsForV2 (ON_BrepFace &face, const ON_NurbsSurface &nurbs_surface)
 
void RebuildTrimsForV2 (ON_BrepFace &face, const ON_NurbsSurface &nurbs_surface, double min_tol)
 
const ON_BrepRegionTopologyRegionTopology () const
 
bool RemoveNesting (bool bExtractSingleSegments, bool bEdges=true, bool bTrimCurves=true)
 
bool RemoveSlits ()
 
bool RemoveSlits (ON_BrepFace &F)
 
bool RemoveSlits (ON_BrepLoop &L)
 
int RemoveWireEdges (bool bDeleteVertices=true)
 
int RemoveWireVertices ()
 
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 SetCurvatureColorAnalysisColors (bool bLazySet, ON_SurfaceCurvatureColorMapping kappa_colors) const
 Sets the vertex colors of the brep's faces' analysis meshes from the principal surface curvatures. More...
 
bool SetDraftAngleColorAnalysisColors (bool bLazySet, ON_SurfaceDraftAngleColorMapping draft_angle_colors) const
 Sets the vertex colors of the brep's faces' analysis meshes from the draft angle of the surface normals. /// More...
 
bool SetEdgeCurve (ON_BrepEdge &edge, int c3_index, const ON_Interval *sub_domain=nullptr)
 
bool SetEdgeDomain (int, const ON_Interval &)
 
virtual bool SetEdgeTolerance (ON_BrepEdge &edge, bool bLazy=false) const
 
bool SetEdgeTolerances (bool bLazy=false)
 
void SetSolidOrientationForExperts (int solid_orientation)
 
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)
 
virtual bool SetTrimBoundingBox (ON_BrepTrim &trim, bool bLazy=false)
 
virtual bool SetTrimBoundingBoxes (bool bLazy=false)
 
virtual bool SetTrimBoundingBoxes (ON_BrepFace &face, bool bLazy=false)
 
virtual bool SetTrimBoundingBoxes (ON_BrepLoop &loop, bool bLazy=false)
 
bool SetTrimCurve (ON_BrepTrim &trim, int c2_index, const ON_Interval *sub_domain=nullptr)
 
bool SetTrimDomain (int, const ON_Interval &)
 
bool SetTrimIsoFlags ()
 sets all trim iso flags More...
 
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)
 
bool SetTrimTypeFlags (bool bLazy=false)
 sets all trim iso flags More...
 
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)
 
void SetVertices (void)
 
bool ShrinkSurface (ON_BrepFace &face, int DisableSide=0)
 
bool ShrinkSurfaces ()
 
unsigned int SizeOf () const override
 virtual ON_Object::SizeOf override More...
 
virtual int SolidOrientation () const
 
bool SortFaceLoops (ON_BrepFace &face) const
 
bool SplitBipolarFaces ()
 
bool SplitBipolarFaces (bool bShrinkInSplitDirection)
 
bool SplitClosedFaces (int min_degree, bool bShrinkInSplitDirection)
 
bool SplitClosedFaces (int min_degree=0)
 
bool SplitEdge (int edge_index, double edge_t, const ON_SimpleArray< double > &trim_t, int vertex_index=-1, bool bSetTrimBoxesAndFlags=true)
 
int SplitEdgeAtParameters (int edge_index, int edge_t_count, const double *edge_t)
 
virtual bool SplitKinkyEdge (int edge_index, double kink_tol_radians=ON_DEFAULT_ANGLE_TOLERANCE)
 
virtual bool SplitKinkyFace (int face_index, double kink_tol_radians=ON_DEFAULT_ANGLE_TOLERANCE)
 
bool SplitKinkyFaces (double kink_tol_radians=ON_DEFAULT_ANGLE_TOLERANCE, bool bCompactIfNeeded=true)
 
void Standardize ()
 
bool StandardizeEdgeCurve (int edge_index, bool bAdjustEnds)
 
bool StandardizeEdgeCurve (int edge_index, bool bAdjustEnds, int EdgeCurveUse)
 
void StandardizeEdgeCurves (bool bAdjustEnds)
 
bool StandardizeFaceSurface (int face_index)
 
void StandardizeFaceSurfaces ()
 
bool StandardizeTrimCurve (int trim_index)
 
void StandardizeTrimCurves ()
 
ON_BrepSubBrep (int subfi_count, const int *sub_fi, ON_Brep *sub_brep=0) const
 
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
 
ON_BrepTrimTrim (ON_COMPONENT_INDEX trim_index) const
 
int TrimCurveUseCount (int c2_index, int max_count=0) const
 
ON_BrepTrim::TYPE TrimType (const ON_BrepTrim &trim, bool bLazy=true) const
 
ON_BrepVertexVertex (int vertex_index) const
 
ON_BrepVertexVertex (ON_COMPONENT_INDEX vertex_index) const
 
bool VolumeMassProperties (ON_MassProperties &mp, bool bVolume=true, bool bFirstMoments=true, bool bSecondMoments=true, bool bProductMoments=true, ON_3dPoint base_point=ON_3dPoint::UnsetPoint, double rel_tol=1.0e-6, double abs_tol=1.0e-6) 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
 
virtual ON_COMPONENT_INDEX ComponentIndex () const
 
bool GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const
 
bool GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
virtual bool Morph (const class ON_SpaceMorph &morph)
 
ON_Geometryoperator= (const ON_Geometry &)=default
 
bool Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center)
 
bool Scale (double scale_factor)
 
const ON_BoundingBox TightBoundingBox () const
 
bool Translate (const ON_3dVector &translation_vector)
 
- 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)
 
unsigned int ClearAllComponentStates () const
 
void CopyUserData (const ON_Object &source_object)
 
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
 
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
 
bool DetachUserData (class ON_UserData *pUserData)
 
void EmergencyDestroy ()
 
class ON_UserDataFirstUserData () const
 
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
 
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
 
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
 
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
 
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
 
bool IsKindOf (const ON_ClassId *pClassId) const
 
virtual ON_UUID ModelObjectId () const
 
void MoveUserData (ON_Object &source_object)
 
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
 
ON_Objectoperator= (const ON_Object &)
 
void PurgeUserData ()
 
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
 
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
 
bool ThisIsNullptr (bool bSilentError) const
 
void TransformUserData (const class ON_Xform &xform)
 
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
 
int UserStringCount () const
 

Static Public Member Functions

static ON_BrepNew ()
 
static ON_BrepNew (const ON_Brep &)
 

Public Attributes

ON_U m_brep_user
 
ON_CurveArray m_C2
 
ON_CurveArray m_C3
 Pointers to 3d curves (used by edges). More...
 
ON_BrepEdgeArray m_E
 edges More...
 
ON_BrepFaceArray m_F
 faces More...
 
ON_BrepLoopArray m_L
 loops More...
 
ON_SurfaceArray m_S
 Pointers to parametric surfaces (used by faces) More...
 
ON_BrepTrimArray m_T
 trims More...
 
ON_BrepVertexArray m_V
 vertices More...
 

Static Public Attributes

static unsigned int ErrorCount
 
- Static Public Attributes inherited from ON_Geometry
const static ON_Geometry Unset
 

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 &)
 reads legacy Rhino 1.1 b-rep More...
 
bool ReadOld200 (ON_BinaryArchive &, int)
 reads legacy trimmed surface More...
 
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)
 
void SetTrimIsoFlag (int, double[6])
 helpers to set ON_BrepTrim::m_iso flag More...
 
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_SleepLockGuard
 
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
}
 

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 )

3d curve used by ON_BrepEdge

◆ AddSurface()

int ON_Brep::AddSurface ( ON_Surface )

3d surface used by ON_BrepFace

◆ AddTrimCurve()

int ON_Brep::AddTrimCurve ( ON_Curve )

Creation Interface.

These add a new geometry piece to the b-rep and return the index that should be used to reference the geometry. -1 is returned if the input is not acceptable. ~ON_Brep() will delete the geometry. 2d curve used by ON_BrepTrim

◆ AggregateComponentStatus()

ON_AggregateComponentStatus ON_Brep::AggregateComponentStatus ( ) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ Append()

void ON_Brep::Append ( const ON_Brep )

appends a copy of brep to this and updates indices of appended brep parts. Duplicates are not removed.

◆ AreaMassProperties()

bool ON_Brep::AreaMassProperties ( ON_MassProperties mp,
bool  bArea = true,
bool  bFirstMoments = true,
bool  bSecondMoments = true,
bool  bProductMoments = true,
double  rel_tol = 1.0e-6,
double  abs_tol = 1.0e-6 
) const

Description: Calculate area mass properties of the brep. Parameters: mp - [out] bArea - [in] true to calculate area bFirstMoments - [in] true to calculate area first moments, area and area centroid. bSecondMoments - [in] true to calculate area second moments. bProductMoments - [in] true to calculate area product moments. Returns: True if successful.

◆ BrepComponent()

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

Description: 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

Description: 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. Remarks: Override of virtual ON_Geometry::BrepForm

Reimplemented from ON_Geometry.

◆ ChangeVertex()

bool ON_Brep::ChangeVertex ( int  old_vi,
int  new_vi,
bool  bClearTolerances 
)

Description: 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 to 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. Remarks: 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 ( ) const

zero all brep's m_edge_user values

◆ Clear_edge_user_i() [2/2]

void ON_Brep::Clear_edge_user_i ( int  ) const

zero all brep's m_edge_user values

◆ Clear_face_user_i()

void ON_Brep::Clear_face_user_i ( ) const

zero all brep's m_face_user values

◆ Clear_loop_user_i()

void ON_Brep::Clear_loop_user_i ( ) const

zero all brep's m_loop_user values

◆ Clear_trim_user_i()

void ON_Brep::Clear_trim_user_i ( ) const

zero all brep's m_trim_user values

◆ Clear_user_i()

void ON_Brep::Clear_user_i ( ) const

zero all brep's m_*_user values

◆ Clear_vertex_user_i()

void ON_Brep::Clear_vertex_user_i ( ) const

zero all brep's m_vertex_user values

◆ ClearBoundingBox()

void ON_Brep::ClearBoundingBox ( )
overridevirtual

virtual ON_Geometry::ClearBoundingBox() override

Reimplemented from ON_Geometry.

◆ ClearComponentStates() [1/2]

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

virtual

Reimplemented from ON_Object.

◆ ClearComponentStates() [2/2]

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

virtual

Component status interface

Reimplemented from ON_Object.

◆ ClearEdgeVertices()

void ON_Brep::ClearEdgeVertices ( )
protected

◆ ClearPerFaceColors()

unsigned int ON_Brep::ClearPerFaceColors ( ) const

Description: Removes all per face color overrides. Returns: Number of changed faces. Remarks: Per face colors are a mutable property on ON_BrepFace and are set with ON_BrepFace.SetPerFaceColor().

◆ ClearPerFaceMaterialChannelIndices()

unsigned int ON_Brep::ClearPerFaceMaterialChannelIndices ( )

Description: Removes all per face material channel index overrides. Returns: Number of changed faces. Remarks: Per face material channel indices are a mutable property on ON_BrepFace and are set with ON_BrepFace.SetMaterialChannelIndex().

◆ ClearTrimVertices()

void ON_Brep::ClearTrimVertices ( )
protected

◆ CloseTrimGap()

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

Description: Expert user tool to remove any gap between adjacent trims. Parameters: trim0 - [in] trim1 - [in] Returns: True if successful. Remarks: 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 
)

Description: 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. Remarks: 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  
)

moves information to first edge and deletes second

Description: Expert user function. See Also: ON_Brep::JoinEdges

◆ CombineCoincidentVertices()

bool ON_Brep::CombineCoincidentVertices ( ON_BrepVertex ,
ON_BrepVertex  
)

moves information to first vertex and deletes second

Description: 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 
)

Description: 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. Remarks: 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 ( )

Description: 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

This function examines the 2d parameter space curves and returns the loop's type based on their orientation. Use this function for debugging loop orientation problems.

◆ Create() [1/5]

bool ON_Brep::Create ( ON_NurbsSurface *&  pNurbsSurface)

◆ Create() [2/5]

bool ON_Brep::Create ( ON_PlaneSurface *&  pPlaneSurface)

◆ Create() [3/5]

bool ON_Brep::Create ( ON_RevSurface *&  pRevSurface)

◆ Create() [4/5]

bool ON_Brep::Create ( ON_SumSurface *&  pSumSurface)

◆ Create() [5/5]

bool ON_Brep::Create ( ON_Surface *&  pSurface)

Description: 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: @untitled 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.
Remarks: The surface class must be created with new so that the delete in ~ON_Brep will not cause a crash.

◆ CreateMesh()

int ON_Brep::CreateMesh ( const ON_MeshParameters mp,
ON_SimpleArray< ON_Mesh * > &  mesh_list 
) const

Description: 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. Note: This function is not thread safe.

◆ CullUnused2dCurves()

bool ON_Brep::CullUnused2dCurves ( )

culls 3d curves not referenced by an edge

◆ CullUnused3dCurves()

bool ON_Brep::CullUnused3dCurves ( )

culls 2d curves not referenced by a trim

◆ CullUnusedEdges()

bool ON_Brep::CullUnusedEdges ( )

culls edges with m_edge_index == -1

◆ CullUnusedFaces()

bool ON_Brep::CullUnusedFaces ( )

culls faces with m_face_index == -1

◆ CullUnusedLoops()

bool ON_Brep::CullUnusedLoops ( )

culls loops with m_loop_index == -1

◆ CullUnusedSurfaces()

bool ON_Brep::CullUnusedSurfaces ( )

culls surfaces not referenced by a face

◆ CullUnusedTrims()

bool ON_Brep::CullUnusedTrims ( )

culls trims with m_trim_index == -1

◆ CullUnusedVertices()

bool ON_Brep::CullUnusedVertices ( )

culls vertices with m_vertex_index == -1

◆ 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 
)

pass true to delete vertices used only by edge

◆ DeleteFace()

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

pass true to delete edges and vertices used only by face

◆ DeleteLoop()

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

pass true to delete edges and vertices used only by trim

◆ DeleteSurface()

void ON_Brep::DeleteSurface ( int  s_index)

◆ DeleteTrim()

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

pass true to delete edges and vertices used only by trim

◆ DeleteVertex()

void ON_Brep::DeleteVertex ( ON_BrepVertex vertex)

These remove a topology piece from a b-rep but do not rearrange the arrays that hold the brep objects. The deleted objects have their indices set to -1. Deleting an object that is connected to other objects will modify those objects.

◆ Destroy()

void ON_Brep::Destroy ( )

construction/destruction helpers

returns Brep to state it has after default construction

◆ DestroyMesh() [1/2]

void ON_Brep::DestroyMesh ( ON::mesh_type  mesh_type)

Description: Destroy meshes used to render and analyze brep. Parameters: mesh_type - [in] type of mesh to destroy See Also: ON_Brep::GetMesh ON_BrepFace::DestroyMesh ON_BrepFace::Mesh ON_BrepFace::SetMesh

◆ DestroyMesh() [2/2]

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

Description: 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

Deprecated:
bDeleteMesh=false is no longer supported

◆ DestroyRegionTopology()

void ON_Brep::DestroyRegionTopology ( )

Description: 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)

Description: 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

for debugging

Reimplemented from ON_Object.

◆ DuplicateFace()

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

Description: 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. Remarks: 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

Description: 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. Remarks: 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

Description: 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

Description: 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)

Description: 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

Description: 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

along the edges of the underlying surface. In this case the geometry of the surface is the same as the geometry of the face. If FaceIsSurface() is true, then m_S[m_F[face_index].m_si] is the surface. The flag m_F[face_index].m_bRev records the correspondence between the surface's natural parametric orientation and the orientation of face in the b-rep.

◆ Flip()

void ON_Brep::Flip ( )

Reverses entire brep orientation of all faces by toggling value of all face's ON_BrepFace::m_bRev flag.

◆ 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 )

reverses orientation of trimming loop

Reverses orientation of trimming loop. This function is intended to be used by brep experts and does does NOT modify ON_BrepLoop::m_type. You should make sure ON_BrepLoop::m_type jibes with the loop's direction. (Outer loops should be counter-clockwise and inner loops should be clockwise.) You can use ON_Brep::LoopDirection() to determine the direction of a loop.

◆ FlipReversedSurfaces()

bool ON_Brep::FlipReversedSurfaces ( )

Modification Interface.

Clears all ON_BrepFace.m_bRev flags by ON_BrepFace::Transpose on each face with a true m_bRev.

◆ 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

Description: If this brep has two or more connected components, then duplicates of the connected components are appended to the components[] array. Parameters: components - [out] 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

◆ GetEdgeParameter()

bool ON_Brep::GetEdgeParameter ( int  trim_index,
double  trim_t,
double *  edge_t,
bool  bOkToBuildTrimPline = true 
) const

Description: Given a trim and parameter on the 2d trim curve, get the corresponding parameter on the 3d edge curve. Parameters: trim_index - [in] index of trim in m_T array trim_t - [in] parameter on 2d trim curve edge_t - [out] parameter on 3d edge bOkToBuildTrimPline - [in] if true and m_T[trim_index].m_pline[] does not have its edge parameters set, then they are filled in. This is slow the first time, but greatly increases the speed of GetTrimParameter and GetEdgeParameter on subsequent calls. Returns: @untitled table true successful false failure - edge_t not set See Also: ON_Brep::GetEdgeParameter

◆ GetMesh()

int ON_Brep::GetMesh ( ON::mesh_type  mesh_type,
ON_SimpleArray< const ON_Mesh * > &  meshes 
) const

Description: 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

◆ GetSilhouette()

bool ON_Brep::GetSilhouette ( const ON_SilhouetteParameters  parameters,
const ON_PlaneEquation clipping_planes,
size_t  clipping_plane_count,
ON_ClassArray< ON_SIL_EVENT > &  silhouettes,
ON_ProgressReporter progress,
ON_Terminator terminator 
) const

◆ GetTangentConnectedComponents()

int ON_Brep::GetTangentConnectedComponents ( ON_SimpleArray< ON_Brep * > &  components,
double  angle_tol,
bool  bDuplicateMeshes 
) const

Description: If this brep has two or more components connected by tangent edges, then duplicates of the connected components are appended to the components[] array. Parameters: components - [out] connected components are appended to this array. angle_tol - [in] to determine if an edge is tangent. In radians. 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::GetTangentConnectedComponents

◆ 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

GetTrim2dEnd() evaluates end of the parameter space (2d) trim curve.

◆ GetTrim2dStart()

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

GetTrim2dStart() evaluates the start of the parameter space (2d) trim curve.

Parameters
trim_indexindex of ON_BrepTrim in m_T[] array

◆ GetTrim3dEnd()

bool ON_Brep::GetTrim3dEnd ( int  ,
ON_3dPoint  
) const

GetTrim3dEnd() evaluates the 3d surface at the end of the parameter space (2d) trim curve.

◆ GetTrim3dStart()

bool ON_Brep::GetTrim3dStart ( int  ,
ON_3dPoint  
) const

GetTrim3dStart() evaluates the 3d surface at the start of the parameter space (2d) trim curve.

◆ GetTrimParameter()

bool ON_Brep::GetTrimParameter ( int  trim_index,
double  edge_t,
double *  trim_t,
bool  bOkToBuildTrimPline = true 
) const

Description: Given a trim and parameter on the corresponding 3d edge, get the corresponding parameter on the 2d trim curve. Parameters: trim_index - [in] index of trim in m_T array edge_t - [in] parameter on 3d edge trim_t - [out] parameter on 2d trim curve bOkToBuildTrimPline - [in] if true and m_T[trim_index].m_pline[] does not have its edge parameters set, then they are filled in. This is slow the first time, but greatly increases the speed of GetTrimParameter and GetEdgeParameter on subsequent calls. Returns: @untitled table true successful false failure - trim_t not set See Also: ON_Brep::GetEdgeParameter

◆ HasBrepForm()

bool ON_Brep::HasBrepForm ( ) const
overridevirtual

virtual ON_Geometry::HasBrepForm() override

returns true

Reimplemented from ON_Geometry.

◆ HasPerFaceColors()

bool ON_Brep::HasPerFaceColors ( ) const

Returns: True if one or more faces have per face color overrides. Remarks: Per face colors are a mutable property on ON_BrepFace and are set with ON_BrepFace.SetPerFaceColor().

◆ HasPerFaceMaterialChannelIndices()

bool ON_Brep::HasPerFaceMaterialChannelIndices ( ) const

Returns: True if one or more faces have per face material channel index overrides. Remarks: Per face material channel indices are a mutable property on ON_BrepFace and are set with ON_BrepFace.SetMaterialChannelIndex().

◆ HasRegionTopology()

bool ON_Brep::HasRegionTopology ( ) const

region topology

◆ HasSlits() [1/3]

bool ON_Brep::HasSlits ( ) const

Description: 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

Description: 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

Description: 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

◆ IsCorrupt()

bool ON_Brep::IsCorrupt ( bool  bRepair,
bool  bSilentError,
class ON_TextLog text_log 
) const

Description: Check for corrupt data values that are likely to cause crashes. Parameters: bRepair - [in] If true, const_cast<> will be used to change the corrupt data so that crashes are less likely. bSilentError - [in] If true, ON_ERROR will not be called when corruption is detected. text_log - [out] If text_log is not null, then a description of corruption is printed using text_log. Remarks: Ideally, IsCorrupt() would be a virtual function on ON_Object, but doing that at this point would break the public SDK.

◆ IsDeformable()

bool ON_Brep::IsDeformable ( ) const
overridevirtual

virtual ON_Geometry::IsDeformable() override

Reimplemented from ON_Geometry.

◆ IsDuplicate()

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

Description: Does nothing. Will be deleted in next version.

Deprecated:
Does nothing. Delete call.

◆ IsManifold()

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

Description: 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: If the brep is a manifold, true is returned. Otherwise false is returned. See Also: ON_Brep::IsSolid

Parameters
pbIsOrientedreturns true if b-rep is an oriented manifold

◆ IsMorphable()

bool ON_Brep::IsMorphable ( ) const
overridevirtual

virtual ON_Geometry override

Reimplemented from ON_Geometry.

◆ IsPointInside()

bool ON_Brep::IsPointInside ( ON_3dPoint  P,
double  tolerance,
bool  bStrictlyInside 
) const

Description: 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

Description: Test brep to see if it is a solid. (A "solid" is a closed oriented manifold.) Returns: If the brep is a solid, true is returned. Otherwise false is returned. See Also: ON_Brep::SolidOrientation ON_Brep::IsManifold

◆ IsSurface()

bool ON_Brep::IsSurface ( ) const

returns true if the b-rep has a single face and that face is geometrically the same as the underlying surface. I.e., the face has trivial trimming. In this case, the surface is m_S[0]. The flag m_F[0].m_bRev records the correspondence between the surface's natural parametric orientation and the orientation of the b-rep.

◆ IsValid()

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

Description: 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 low-level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. Returns: @untitled 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

Description: Tests brep to see if it is valid for saving in V2 3DM archives. Returns: true if brep is valid for V2 3DM archives. Remarks: V2 breps could not have dangling curves.

◆ IsValidForV2() [2/3]

bool ON_Brep::IsValidForV2 ( const ON_BrepEdge ) const

◆ IsValidForV2() [3/3]

bool ON_Brep::IsValidForV2 ( const ON_BrepTrim ) const

◆ IsValidGeometry()

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

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

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

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

◆ JoinEdges()

bool ON_Brep::JoinEdges ( ON_BrepEdge edge,
ON_BrepEdge other_edge,
double  join_tolerance,
bool  bCheckFaceOrientaion = true 
)

Description: Join coincident edges. Parameters: edge - [in] this edge will survive the joining process and the vertices at its ends will survive the joining process. other_edge - [in] this edge and the vertices at its ends will be removed. join_tolerance - [in] The distances between the ends of edge and other_edge must be at most join_tolerance in order for the edges to be joined. The caller is responsible for insuring that the 3d location of other_edge is within join_tolerance of edge. bCheckFaceOrientaion - [in] If true and edge and other_edge are boundary edges, then the orientation of the face using other_edge is adjusted to match the orientation of the face using edge. Returns: true if join is successful Example:

/ extrude an edge of a brep to make a new face / NOTE WELL: / THIS IS A SIMPLE EXAMPLE THAT IS NOT VERY EFFICIENT / Use ON_BrepExtrudeEdge if you really want to extrude an edge. ON_Brep brep = ...; / edge = some valid edge in brep const ON_BrepEdge& edge = brep.m_E[...];

/ extrude edge to make a surface ON_3dVector v = ...; ON_SumSurface* new_surface = new ON_SumSurface(); new_surface->Create( edge, v );

/ ON_Brep new_brep; new_brep.AddFace( Create( new_surface ); brep.

See Also: ON_Brep:CullUnusedEdges ON_Brep:CullUnusedVertices ON_Brep:CullUnused3dCurves

◆ LabelConnectedComponent()

void ON_Brep::LabelConnectedComponent ( int  face_index,
int  label 
) const

Description: 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: Remarks: Chases through trim lists of face edges to find adjacent faces. Does NOT check for vertex-vertex connections

◆ LabelConnectedComponents()

int ON_Brep::LabelConnectedComponents ( ) const

Description: 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. Parameters: Returns: number of connected components Remarks: For each face in the i-th 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

◆ LabelTangentConnectedComponent()

void ON_Brep::LabelTangentConnectedComponent ( int  face_index,
double  atol,
int  label 
) const

Description: 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 angle_tol - [in] to determine if an edge is tangent. In radians. label - [in] value for m_*_user.i Returns: Remarks: Chases through trim lists of face edges to find tangent adjacent faces. Does NOT check for vertex-vertex connections

◆ LabelTangentConnectedComponents()

int ON_Brep::LabelTangentConnectedComponents ( double  angle_tol) const

Description: 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. Parameters: angle_tol - [in] to determine if an edge is tangent. In radians. Returns: number of connected components Remarks: For each face in the i-th 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

Description: 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

Description: 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

Description: 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

Description: 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

LoopDirection() examines the 2d trimming curve geometry that defines the loop and returns

@untitled table +1 the loop is a counter-clockwise loop. -1 the loop is a clockwise loop. 0 the loop is not a continuous closed loop.

Since LoopDirection() calculates its result based on the 2d trimming curve geometry, it can be use to set ON_BrepLoop::m_type to outer/inner when translating from data definition where this distinction is murky.

◆ LoopIsSurfaceBoundary()

bool ON_Brep::LoopIsSurfaceBoundary ( int  ) const

parameter space.

◆ MakeDeformable()

bool ON_Brep::MakeDeformable ( )
overridevirtual

virtual ON_Geometry::MakeDeformable() override

Reimplemented from ON_Geometry.

◆ MakeTrimCurveNurb()

ON_NurbsCurve* ON_Brep::MakeTrimCurveNurb ( ON_BrepTrim T)

Description: 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).

◆ MakeValidForV2()

bool ON_Brep::MakeValidForV2 ( )

Description: Change brep so it is valid for saving in V2 3DM archives.

◆ MarkAggregateComponentStatusAsNotCurrent()

void ON_Brep::MarkAggregateComponentStatusAsNotCurrent ( ) const
overridevirtual

virtual

Reimplemented from ON_Object.

◆ MatchTrimEnds() [1/4]

bool ON_Brep::MatchTrimEnds ( )

Description: Match the endpoints of all trims in a brep Parameters: Returns: true if any trim's 2d curve is changed

◆ MatchTrimEnds() [2/4]

bool ON_Brep::MatchTrimEnds ( int  trim_index)

Description: 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)

Description: 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 ( ON_BrepTrim T0,
ON_BrepTrim T1 
)

Match endpoints of adjacent trims. If a trim needs to be adjusted, copy the 2d curve if necessary, convert to NURBS form, yank cvs. Compact() should be called afterwards. Returns false if error in computation, Trims must be from same face and meet at a common vertex. These are expert user functions. When in doubt use MatchTrimEnds() on the entire Brep. Description: 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

◆ MemoryRelocate()

void ON_Brep::MemoryRelocate ( )
overridevirtual

Override of virtual ON_Object::MemoryRelocate.

Reimplemented from ON_Object.

◆ MergeFaces() [1/2]

bool ON_Brep::MergeFaces ( )

Description: Merge all possible faces that have the same m_si Returns: true if any faces were successfully merged. Remarks: Caller should call Compact() when done.

◆ MergeFaces() [2/2]

int ON_Brep::MergeFaces ( int  fid0,
int  fid1 
)

Description: 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. Parameters: 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. Remarks: Caller should call Compact() when done.

◆ Morph()

bool ON_Brep::Morph ( const ON_SpaceMorph morph)
override

virtual ON_Geometry override

◆ New() [1/2]

static ON_Brep* ON_Brep::New ( )
static

Description: 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). Example:

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

Returns: Pointer to an ON_Brep. Destroy by calling delete. Remarks: 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.

◆ New() [2/2]

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

Description: 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. Remarks: 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 
)

Description: 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 
)

Description: 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 Remarks: 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 ( const ON_Surface surface)

Description: 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. Remarks: Adding a new face may grow the dynamic arrays used to store vertices, edges, faces, loops, and trims. When these dynamic 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() [2/3]

ON_BrepFace& ON_Brep::NewFace ( int  si = -1)

Description: 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. Remarks: 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. Example: See ON_BrepBox and ON_BrepSphere source code. See Also: ON_Brep::AddSurface

◆ NewFace() [3/3]

ON_BrepFace* ON_Brep::NewFace ( ON_Surface pSurface,
int  vid[4],
int  eid[4],
bool  bRev3d[4] 
)

Description: 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. Remarks: 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. Example: 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  loop_type,
ON_BrepFace face 
)

Description: 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.

◆ NewLoop() [2/2]

ON_BrepLoop& ON_Brep::NewLoop ( ON_BrepLoop::TYPE  )

Description: 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.

◆ NewOuterLoop() [1/2]

ON_BrepLoop* ON_Brep::NewOuterLoop ( int  face_index)

Description: 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] 
)

Description: 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. Remarks: 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 
)

Description: Add a planar trimming loop to a planar face. Parameters: face_index - [in] index of planar face. The underlying surface 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 
)

Description: 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. Remarks: 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 
)

Description: 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 
)

Description: 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 ( bool  bRev3d,
ON_BrepLoop loop,
int  c2i = -1 
)

Description: 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 Example: 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 = ...; Remarks: 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. 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 ( int  c2i = -1)

Description: 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 Example: 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 = ...; Remarks: 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. 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 
)

Description: 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 Example: 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 = ...; Remarks: 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. 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 
)

Description: 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 Example: int c2i = brep->AddTrimCurve( p2dCurve ); ON_BrepTrim& trim = brep->NewTrim( edge, bRev3d, loop, c2i ); trim.m_tolerance[0] = ...; trim.m_tolerance[1] = ...; Remarks: 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. 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 ( )

These add a new topology piece to the b-rep and return a reference that is intended to be used for initialization.

◆ 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

Description: 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. Remarks: 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 )

◆ PackFaces()

unsigned int ON_Brep::PackFaces ( bool  from_subd = true)

Description: Convert brep face grid packs into single faces. Parameters: from_subd - [in] true if the Brep to pack comes from a SubD to NURBS conversion and has PackIds set on all its faces. Returns: Number of brep face grid packs converted to single faces. Remarks: PackId values assigned to brep faces are inheritied from the PackId values assigned to subd faces when a subd is converted into a brep. These faces are "trivially trimmed" which means the boundary of the face is identical to the boundary of the underlying surface. There are two types of face packs in a subd, quad grid packs and singleton packs. A subd quad grid pack is a set of subd quads that form a rectangular grid. A subd singleton pack is a single face, quad or n-gon, that is not part of a quad grid pack. There are three types of face packs in a brep created from a subd, grid packs, star packs and singleton packs. A brep "grid pack" comes from a rectangular grid of subd quads. A grid pack of brep faces can be converted into a single larger trivially trimmed brep face. A brep "star pack" of brep faces comes from a singel subd n-gon (n = 3, 5 or more). The star pack will have n faces with a star center vertex and shared edges radiating from the star center. A brep "singleton" pack comes from a single subd quad that could not be grouped into a larger subd quad grid pack.

◆ PrevEdge()

int ON_Brep::PrevEdge ( int  current_edge_index,
int  endi,
int *  prev_endi = nullptr 
) const

Description: 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. Remarks: 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 previous/next trim in loop

◆ ProxyBrepSubDRuntimeSerialNumber()

ON__UINT64 ON_Brep::ProxyBrepSubDRuntimeSerialNumber ( ) const

Returns: If this brep was created by ON_SubD::ProxyBrep(), then the value of ON_SubD.RuntimeSerialNumber() is returned.

◆ 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

reads legacy old RhinoIO toolkit b-rep

◆ ReadOld101()

bool ON_Brep::ReadOld101 ( ON_BinaryArchive )
protected

reads legacy Rhino 1.1 b-rep

◆ ReadOld200()

bool ON_Brep::ReadOld200 ( ON_BinaryArchive ,
int   
)
protected

reads legacy trimmed surface

◆ 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

◆ RebuildEdges()

bool ON_Brep::RebuildEdges ( ON_BrepFace face,
double  tolerance,
bool  bRebuildSharedEdges,
bool  bRebuildVertices 
)

Description: Rebuild the edges used by a face so they lie on the surface. Parameters: face - [in] face whose surface should be changed tolerance - [in] tolerance for fitting 3d edge curves bRebuildSharedEdges - [in] if false and and edge is used by this face and a neighbor, then the edge will be skipped. bRebuildVertices - [in] if true, vertex locations are updated to lie on the surface. See Also: ON_Brep::RebuildEdges

◆ RebuildTrimsForV2() [1/2]

void ON_Brep::RebuildTrimsForV2 ( ON_BrepFace face,
const ON_NurbsSurface nurbs_surface 
)

Description: No support is available for this function. Expert user function used by MakeValidForV2 to convert trim curves from one surface to its NURBS form. After calling this function, you need to change the face's surface to nurbs_surface. Parameters: face - [in] face whose underlying surface has a parameterization that is different from its NURBS form. nurbs_surface - [in] NURBS form of the face's underlying surface Remarks: Don't call this function unless you know exactly what you are doing. No support is available.

◆ RebuildTrimsForV2() [2/2]

void ON_Brep::RebuildTrimsForV2 ( ON_BrepFace face,
const ON_NurbsSurface nurbs_surface,
double  min_tol 
)

Description: No support is available for this function. Expert user function used by MakeValidForV2 to convert trim curves from one surface to its NURBS form. After calling this function, you need to change the face's surface to nurbs_surface. Parameters: face - [in] face whose underlying surface has a parameterization that is different from its NURBS form. nurbs_surface - [in] NURBS form of the face's underlying surface min_tol - [in] 3D edges are pulled back using the max of edge tolerance and this Remarks: Don't call this function unless you know exactly what you are doing. No support is available.

◆ RegionTopology()

const ON_BrepRegionTopology& ON_Brep::RegionTopology ( ) const

Description: 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 
)

Description: 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 ( )

Description: remove slit trims and slit boundaries from each face. Returns: true if any slits were removed Remarks: Caller should call Compact() afterwards.

◆ RemoveSlits() [2/3]

bool ON_Brep::RemoveSlits ( ON_BrepFace F)

Description: remove slit trims and slit boundaries from a face. Parameters: F - [in] brep face Returns: true if any slits were removed Remarks: Caller should call Compact() when done.

◆ RemoveSlits() [3/3]

bool ON_Brep::RemoveSlits ( ON_BrepLoop L)

Description: remove slit trims from a loop. Parameters: L - [in] brep loop Returns: true if any slits were removed Remarks: 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)

Description: 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. Remarks: 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.

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

Description: Remove vertices that are not connected to an edge. Returns: Number of vertices that were deleted. Remarks: 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

set every brep m_*_user value to u

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

◆ SetCurvatureColorAnalysisColors()

bool ON_Brep::SetCurvatureColorAnalysisColors ( bool  bLazySet,
ON_SurfaceCurvatureColorMapping  kappa_colors 
) const

Sets the vertex colors of the brep's faces' analysis meshes from the principal surface curvatures.

The color ON_MappingTag::CurvatureAnalysisColor(kappa_style,kappa_range) is assigned to the fragments's vertex color setting.

The SHA1 hash ON_MappingTag::CurvatureColorAnalysisParametersHash(kappa_style,kappa_range) is used to identify this method of setting the fragments' vertex colors when SHA1 hashes are used.

The mapping tag ON_MappingTag::CurvatureAnalysisMappingTag(kappa_style,kappa_range) is used to identify this method of setting the fragments' vertex colors when mapping tags are used.

See ON_SurfaceCurvature::KappaValue()

Parameters
bLazySet

If bLazySet and a fragment has a matching tag, hash, and set vertex colors, then the existing colors are assumed to be correctly set. When in doubt, pass true.

Parameters
kappa_colorskappa_colors.Color(K) is the color assigned to the surface principal curvatures K.
Returns

◆ SetDraftAngleColorAnalysisColors()

bool ON_Brep::SetDraftAngleColorAnalysisColors ( bool  bLazySet,
ON_SurfaceDraftAngleColorMapping  draft_angle_colors 
) const

Sets the vertex colors of the brep's faces' analysis meshes from the draft angle of the surface normals. ///

Parameters
bLazySetIf bLazySet and a fragment has a matching tag, hash, and set vertex colors, then the existing colors are assumed to be correctly set. When in doubt, pass true.
draft_angle_colors
Returns

◆ SetEdgeCurve()

bool ON_Brep::SetEdgeCurve ( ON_BrepEdge edge,
int  c3_index,
const ON_Interval sub_domain = nullptr 
)

Description: 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  
)

Change the domain of an edge. This changes only the parameterization of the 3d edge curve; the locus of the 3d edge curve is not changed.

◆ SetEdgeTolerance()

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

◆ SetEdgeTolerances()

bool ON_Brep::SetEdgeTolerances ( bool  bLazy = false)

Description: 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

◆ SetSolidOrientationForExperts()

void ON_Brep::SetSolidOrientationForExperts ( int  solid_orientation)

Description: When an expert is 100% certain of a brep's solid orientation, this function can be used to set the SolidOrientation() property. Parameters: solid_orientation - [in] 0: not solid, 1: oriented manifold solid (no boundary) with outward facing normals. -1: oriented manifold solid (no boundary) with inward facing normals.

◆ 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 
)

Description: 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

Description: 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 ( bool  bLazy = false)
virtual

Description: 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.

◆ SetTrimBoundingBoxes() [2/3]

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

Description: 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 ( ON_BrepLoop loop,
bool  bLazy = false 
)
virtual

Description: 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.

◆ SetTrimCurve()

bool ON_Brep::SetTrimCurve ( ON_BrepTrim trim,
int  c2_index,
const ON_Interval sub_domain = nullptr 
)

Description: 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  
)

Change the domain of a trim's 2d curve. This changes only the parameterization of the 2d trimming curve; the locus of the 2d trimming curve is not changed.

◆ SetTrimIsoFlag() [1/2]

void ON_Brep::SetTrimIsoFlag ( int  )
protected

◆ SetTrimIsoFlag() [2/2]

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

helpers to set ON_BrepTrim::m_iso flag

◆ SetTrimIsoFlags() [1/4]

bool ON_Brep::SetTrimIsoFlags ( )

sets all trim iso flags

This function can be used to set the ON_BrepTrim::m_iso flag. It is intended to be used when creating a ON_Brep from a definition that does not include compatible parameter space type information. See Also: ON_BrepSetFlagsAndTolerances

◆ 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)

Description: 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)

sets all trim iso flags

This function can be used to set the ON_BrepTrim::m_type flag. If the optional bLazy argument is true, then only trims with m_type = unknown are set. See Also: ON_BrepSetFlagsAndTolerances

◆ 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

These set the various tolerances. The optional bool argument is called bLazy. If bLazy is false, the tolerance is recomputed from its definition. If bLazy is true, the tolerance is computed only if its current value is negative.

◆ SetVertexTolerances()

bool ON_Brep::SetVertexTolerances ( bool  bLazy = false)

Description: 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  )

This function can be used to compute vertex information for a b-rep when everything but the m_V array is properly filled in. It is intended to be used when creating a ON_Brep from a definition that does not include explicit vertex information.

◆ ShrinkSurface()

bool ON_Brep::ShrinkSurface ( ON_BrepFace face,
int  DisableSide = 0 
)

Description: 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. @table
value meaning 0x0001 Don't shrink on the west side of domain. 0x0002 Don't shrink on the south side of domain. 0x0004 Don't shrink on the east side of domain. 0x0008 Don't shrink on the north side of domain. Returns: @untitled table true successful false failure Remarks: 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 ( )

Description: 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: @untitled table true successful false failure Remarks: 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

Description: Determine orientation of a brep. Returns: @untitle 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 Remarks: 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

Description: 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: @untitled table true success false failure - no loops or loops with unset loop.m_type See Also: ON_Brep::ComputeLoopType ON_Brep::LoopDirection

◆ SplitBipolarFaces() [1/2]

bool ON_Brep::SplitBipolarFaces ( )

◆ SplitBipolarFaces() [2/2]

bool ON_Brep::SplitBipolarFaces ( bool  bShrinkInSplitDirection)

Description: Splits surfaces with two singularities, like spheres, so the results have at most one singularity. Parameters: bShrinkInSplitDirection - [in] If true, the face's surface is shrunk so the surface's edge coincides with the split. Returns: True if successful. Remarks: The version of the function without the bShrinkInSplitDirection parameter does not split the surface.

◆ SplitClosedFaces() [1/2]

bool ON_Brep::SplitClosedFaces ( int  min_degree,
bool  bShrinkInSplitDirection 
)

Description: Splits closed surfaces so they are not closed. Parameters: min_degree - [in] If the degree of the surface < min_degree, the surface is not split. In some cases, min_degree = 2 is useful to preserve piecewise linear surfaces. bShrinkInSplitDirection - [in] If true, the face's surface is shrunk so the surface's edge coincides with the split. Returns: True if successful. Remarks: The version of the function without the bShrinkInSplitDirection parameter does not split the surface.

◆ SplitClosedFaces() [2/2]

bool ON_Brep::SplitClosedFaces ( int  min_degree = 0)

◆ SplitEdge()

bool ON_Brep::SplitEdge ( int  edge_index,
double  edge_t,
const ON_SimpleArray< double > &  trim_t,
int  vertex_index = -1,
bool  bSetTrimBoxesAndFlags = true 
)

Description: Expert user function. Splits an edge into two edges. The input edge becomes the left portion and a new edge is created for the right portion. Parameters: edge_index - [in] index of edge in brep.m_E[] edge_t - [in] 3d edge splitting parameter trim_t - [in] array of trim splitting parameters. trim_t[eti] is the parameter for splitting the trim brep.m_T[edge.m_ti[eti]]. vertex_index - [in] if not -1, then this vertex will be used for the new vertex. Otherwise a new vertex is created. bSetTrimBoxesAndFlags - [in] if true, trim boxes and flags are set. If false, the user is responsible for doing this. Set to true if you are unsure what to use. If you pass false, then need to call SetTrimBoundingBoxes(..,bLazy=true) so that the trim iso flags and bounding info is correctly updated. If you pass true, then the trim flags and bounding boxes get set inside of SplitEdge. Returns: True if successful.

◆ SplitEdgeAtParameters()

int ON_Brep::SplitEdgeAtParameters ( int  edge_index,
int  edge_t_count,
const double *  edge_t 
)

Description: Split an edge at the specified parameters. Parameters: edge_index - [in] Index of the edge to split. edge_t_count - [in] number of edge parameters edge_t - [in] edge parameters Returns: Number of splits applied to the edge. Remarks: This function leaves deleted stuff in the brep.
Call ON_Brep::Compact() to remove deleted stuff.

◆ SplitKinkyEdge()

virtual bool ON_Brep::SplitKinkyEdge ( int  edge_index,
double  kink_tol_radians = ON_DEFAULT_ANGLE_TOLERANCE 
)
virtual

Description: Split the edge into G1 pieces. Parameters: edge_index - [in] Index of the edge to test and split. kink_tol_radians - [in] kink tolerance Returns: True if successful. Remarks: This function leaves deleted stuff in the brep.
Call ON_Brep::Compact() to remove deleted stuff.

Parameters
kink_tol_radiansON_PI/180.0

◆ SplitKinkyFace()

virtual bool ON_Brep::SplitKinkyFace ( int  face_index,
double  kink_tol_radians = ON_DEFAULT_ANGLE_TOLERANCE 
)
virtual

Description: Split the face into G1 pieces. Parameters: face_index - [in] Index of the face to test and split. kink_tol_radians - [in] kink tolerance Returns: True if successful. Remarks: This function leaves deleted stuff in the brep.
Call ON_Brep::Compact() to remove deleted stuff.

Parameters
kink_tol_radiansON_PI/180.0

◆ SplitKinkyFaces()

bool ON_Brep::SplitKinkyFaces ( double  kink_tol_radians = ON_DEFAULT_ANGLE_TOLERANCE,
bool  bCompactIfNeeded = true 
)

Description: Split any faces with creases into G1 pieces. Parameters: kink_tol_radians - [in] kink tolerance bCompactIfNeeded - [in] If true and splitting is performed, ON_Brep::Compact() will be called to clean up the unused parts. Returns: True if successful. Remarks: If you need to detect when splitting occurred, compare the before and after values of m_F.Count().

◆ Standardize()

void ON_Brep::Standardize ( )

Description: Standardize all trims, edges, and faces in the brep. Remarks: 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 
)

Description: 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 
)

Description: 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)

Description: 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)

Description: 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 ( )

Description: Standardize all faces in the brep. See Also: ON_Brep::StandardizeFaceSurface ON_Brep::Standardize

◆ StandardizeTrimCurve()

bool ON_Brep::StandardizeTrimCurve ( int  trim_index)

Description: 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 ( )

Description: 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

Description: 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 sub-brep will be created in this class. Returns: If the input is valid, a pointer to the sub-brep is returned. If the input is not valid, null is returned. The faces in in the sub-brep'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.

Description: 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

Description: 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

Description: 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

Description: 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 calculated. Returns: Type of trim. Remarks: 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

Description: 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

◆ VolumeMassProperties()

bool ON_Brep::VolumeMassProperties ( ON_MassProperties mp,
bool  bVolume = true,
bool  bFirstMoments = true,
bool  bSecondMoments = true,
bool  bProductMoments = true,
ON_3dPoint  base_point = ON_3dPoint::UnsetPoint,
double  rel_tol = 1.0e-6,
double  abs_tol = 1.0e-6 
) const

Description: Calculate volume mass properties of the brep. Parameters: mp - [out] bVolume - [in] true to calculate volume bFirstMoments - [in] true to calculate volume first moments, volume, and volume centroid. bSecondMoments - [in] true to calculate volume second moments. bProductMoments - [in] true to calculate volume product moments. base_point - [in] If the brep is closed, then pass ON_UNSET_VALUE.

This parameter is for expert users who are computing a volume whose boundary is defined by several non-closed breps, surfaces, and meshes.

When computing the volume, volume centroid, or volume first moments of a volume whose boundary is defined by several breps, surfaces, and meshes, pass the same base_point to each call to VolumeMassProperties.

When computing the volume second moments or volume product moments of a volume whose boundary is defined by several breps, surfaces, and meshes, you MUST pass the entire volume's centroid as the base_point and the input mp parameter must contain the results of a previous call to VolumeMassProperties(mp,true,true,false,false,base_point). In particular, in this case, you need to make two sets of calls; use first set to calculate the volume centroid and the second set calculate the second moments and product moments. Returns: True if successful.

◆ 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

These are friends so legacy tol values stored in v1 3dm files can be used to set brep edge and trimming tolerances with a call to ON_Brep::SetTolsFromLegacyValues().

◆ 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_SleepLockGuard

friend class ON_SleepLockGuard
friend

Not ideal - used in debugging and testing bool GetLock(); bool GetLockOrReturnFalse(); bool ReturnLock(); In calculations where multiple threads are using a brep and calling functions that may modify content, the calling code can use use ON_SleepLockGuard guard(Mutex) or similar techniques to make the calculations thread safe. Because Mutex is a public resource, it must be used with great care to prevent lock contention.

◆ ON_V5_BrepRegionTopologyUserData

friend class ON_V5_BrepRegionTopologyUserData
friend

Member Data Documentation

◆ ErrorCount

unsigned int ON_Brep::ErrorCount
static

The ON_Brep code increments ON_Brep::ErrorCount every time something unexpected happens. This is useful for debugging.

◆ m_aggregate_status

ON_AggregateComponentStatus ON_Brep::m_aggregate_status
mutableprotected

m_aggregate_status "should" be an ON_AggregateComponentStatusEx, but that change requires breaking the C++ SDK.

◆ m_bbox

ON_BoundingBox ON_Brep::m_bbox
protected

◆ m_brep_user

ON_U ON_Brep::m_brep_user
mutable

Union available for application use. The constructor zeros m_brep_user. The value is of m_brep_user is not saved in 3DM archives and may be changed by some computations.

◆ m_C2

ON_CurveArray ON_Brep::m_C2

geometry (all geometry is deleted by ~ON_Brep(). Pointers can be nullptr or not referenced. Use Compact() to remove unreferenced geometry. Pointers to parameter space trimming curves (used by trims).

◆ m_C3

ON_CurveArray ON_Brep::m_C3

Pointers to 3d curves (used by edges).

◆ m_E

ON_BrepEdgeArray ON_Brep::m_E

edges

◆ m_F

ON_BrepFaceArray ON_Brep::m_F

faces

◆ m_is_solid

int ON_Brep::m_is_solid = 0
protected

Never directly set m_is_solid, use calls to IsSolid() and/or SolidOrientation() when you need to know the answer to this question. 0 = unset 1 = solid with normals pointing out 2 = solid with normals pointing in 3 = not solid

◆ m_L

ON_BrepLoopArray ON_Brep::m_L

loops

◆ m_region_topology

class ON_BrepRegionTopology* ON_Brep::m_region_topology = nullptr
protected

◆ m_S

ON_SurfaceArray ON_Brep::m_S

Pointers to parametric surfaces (used by faces)

◆ m_T

ON_BrepTrimArray ON_Brep::m_T

trims

◆ m_V

ON_BrepVertexArray ON_Brep::m_V

vertices

topology (all topology is deleted by ~ON_Brep(). Objects can be unreferenced. Use Compact() to to remove unreferenced geometry.