Rhino C++ API  7.19
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
ON_BrepTrim Class Reference

#include <opennurbs_brep.h>

Inheritance diagram for ON_BrepTrim:
ON_CurveProxy ON_Curve ON_Geometry ON_Object

Public Types

enum  TYPE {
  unknown = 0, boundary = 1, mated = 2, seam = 3,
  singular = 4, crvonsrf = 5, ptonsrf = 6, slit = 7,
  trim_type_count = 8, force_32_bit_trim_type = 0xFFFFFFFF
}
 types of trim - access through m_type member. Also see m_iso and ON_Surface::ISO More...
 
- 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
}
 

Public Member Functions

 ON_BrepTrim ()
 
 ON_BrepTrim (int)
 trim index More...
 
bool AttachToEdge (int edge_index, bool bRev3d)
 
ON_BrepBrep () const
 
bool ChangeTrimCurve (int c2i)
 Interface. More...
 
ON_COMPONENT_INDEX ComponentIndex () const override
 virtual ON_Geometry::ComponentIndex() override More...
 
void DestroyPspaceInformation ()
 
void DestroyRuntimeCache (bool bDelete=true) override
 
void Dump (ON_TextLog &) const override
 for debugging More...
 
ON_BrepEdgeEdge () const
 
int EdgeCurveIndexOf () const
 
const ON_CurveEdgeCurveOf () const
 
ON_BrepFaceFace () const
 
int FaceIndexOf () const
 
bool Get3dVectorIntoFace (double trim_t, ON_3dVector &V, ON_3dVector &N) const
 
bool IsSeam () const
 
bool IsSlit () const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
ON_BrepLoopLoop () const
 
bool m__legacy_flags_Get (int *, int *) const
 used internally - ignore More...
 
void m__legacy_flags_Set (int, int)
 values stored in legacy file formats - ignore More...
 
ON_BrepTrimoperator= (const ON_BrepTrim &)
 
bool Read (ON_BinaryArchive &) override
 
bool RemoveFromEdge (bool bRemoveFromStartVertex, bool bRemoveFromEndVertex)
 
bool Reverse () override
 
unsigned int SizeOf () const override
 virtual ON_Object::SizeOf override More...
 
int SurfaceIndexOf () const
 
const ON_SurfaceSurfaceOf () const
 
bool TransformTrim (const ON_Xform &xform)
 
int TrimCurveIndexOf () const
 
const ON_CurveTrimCurveOf () const
 
void UnsetPlineEdgeParameters ()
 
ON_BrepVertexVertex (int tvi) const
 
bool Write (ON_BinaryArchive &) const override
 
- Public Member Functions inherited from ON_CurveProxy
 ON_CurveProxy () ON_NOEXCEPT
 
 ON_CurveProxy (const ON_Curve *)
 
 ON_CurveProxy (const ON_Curve *, ON_Interval)
 
 ON_CurveProxy (const ON_CurveProxy &)
 
virtual ~ON_CurveProxy ()
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const override
 virtual ON_Object::DataCRC override More...
 
int Degree () const override
 
void DestroyRuntimeCache (bool bDelete=true) override
 virtual ON_Object::DestroyRuntimeCache override More...
 
int Dimension () const override
 ON_Geometry overrides. More...
 
ON_Interval Domain () const override
 ON_Curve overrides. More...
 
void Dump (ON_TextLog &) const override
 for debugging More...
 
ON_CurveDuplicateCurve () const override
 
bool Evaluate (double, int, int, double *, int=0, int *=0) const override
 Domain changes from [a,b] to [-b,-a]. More...
 
bool GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const override
 virtual ON_Geometry GetBBox override
More...
 
bool GetClosestPoint (const ON_3dPoint &, double *, double=0.0, const ON_Interval *=nullptr) const override
 
bool GetCurveParameterFromNurbFormParameter (double, double *) const override
 virtual ON_Curve::GetCurveParameterFromNurbFormParameter override More...
 
bool GetLength (double *, double=1.0e-8, const ON_Interval *=nullptr) const override
 
bool GetLocalClosestPoint (const ON_3dPoint &, double, double *, const ON_Interval *=nullptr) const override
 
bool GetNextDiscontinuity (ON::continuity c, double t0, double t1, double *t, int *hint=nullptr, int *dtype=nullptr, double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE, double curvature_tolerance=ON_SQRT_EPSILON) const override
 
bool GetNormalizedArcLengthPoint (double s, double *t, double fractional_tolerance=1.0e-8, const ON_Interval *sub_domain=nullptr) const override
 
bool GetNormalizedArcLengthPoints (int count, const double *s, double *t, double absolute_tolerance=0.0, double fractional_tolerance=1.0e-8, const ON_Interval *sub_domain=nullptr) const override
 
int GetNurbForm (ON_NurbsCurve &, double=0.0, const ON_Interval *=nullptr) const override
 
bool GetNurbFormParameterFromCurveParameter (double, double *) const override
 virtual ON_Curve::GetNurbFormParameterFromCurveParameter override More...
 
bool GetParameterTolerance (double, double *, double *) const override
 (optional - override if curve is piecewise smooth) More...
 
bool GetSpanVector (double *) const override
 
int HasNurbForm () const override
 
bool IsArc (const ON_Plane *=nullptr, ON_Arc *=nullptr, double=ON_ZERO_TOLERANCE) const override
 
bool IsClosed (void) const override
 
bool IsContinuous (ON::continuity c, double t, int *hint=nullptr, double point_tolerance=ON_ZERO_TOLERANCE, double d1_tolerance=ON_ZERO_TOLERANCE, double d2_tolerance=ON_ZERO_TOLERANCE, double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE, double curvature_tolerance=ON_SQRT_EPSILON) const override
 
bool IsInPlane (const ON_Plane &, double=ON_ZERO_TOLERANCE) const override
 
bool IsLinear (double=ON_ZERO_TOLERANCE) const override
 
bool IsPeriodic (void) const override
 periodic.) More...
 
bool IsPlanar (ON_Plane *=nullptr, double=ON_ZERO_TOLERANCE) const override
 
int IsPolyline (ON_SimpleArray< ON_3dPoint > *pline_points=nullptr, ON_SimpleArray< double > *pline_t=nullptr) const override
 virtual override of ON_Curve::IsPolyline More...
 
bool IsShort (double tolerance, const ON_Interval *sub_domain=0, double *length_estimate=0) const override
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 ON_Object overrides. More...
 
ON_CurveProxyoperator= (const ON_CurveProxy &)
 
const ON_CurveProxyCurve () const
 
ON_Interval ProxyCurveDomain () const
 
bool ProxyCurveIsReversed () const
 
bool Read (ON_BinaryArchive &) override
 
double RealCurveParameter (double t) const
 
bool Reverse () override
 
bool SetDomain (double t0, double t1) override
 
bool SetDomain (ON_Interval domain)
 
void SetProxyCurve (const ON_Curve *real_curve)
 
void SetProxyCurve (const ON_Curve *real_curve, ON_Interval real_curve_subdomain)
 
bool SetProxyCurveDomain (ON_Interval proxy_curve_subdomain)
 
unsigned int SizeOf () const override
 virtual ON_Object::SizeOf override More...
 
int SpanCount () const override
 number of smooth spans in curve More...
 
bool Split (double t, ON_Curve *&left_side, ON_Curve *&right_side) const override
 override of virtual ON_Curve::Split More...
 
double ThisCurveParameter (double real_curve_parameter) const
 
bool Transform (const ON_Xform &) override
 
bool Trim (const ON_Interval &domain) override
 override of virtual ON_Curve::Trim More...
 
bool Write (ON_BinaryArchive &) const override
 
- Public Member Functions inherited from ON_Curve
 ON_Curve () ON_NOEXCEPT
 
 ON_Curve (const ON_Curve &)
 
virtual ~ON_Curve ()
 
bool AreaMassProperties (ON_3dPoint base_point, ON_3dVector plane_normal, 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
 
virtual bool ChangeClosedCurveSeam (double t)
 
bool ChangeClosedCurveSeam (double t, double min_dist)
 
virtual bool ChangeDimension (int desired_dimension)
 
virtual class ON_CurveTreeCreateCurveTree () const
 
ON_3dVector CurvatureAt (double t) const
 
const class ON_CurveTreeCurveTree () const
 
ON_3dVector DerivativeAt (double t) const
 
void DestroyCurveTree ()
 
bool Ev1Der (double t, ON_3dPoint &point, ON_3dVector &first_derivative, int side=0, int *hint=0) const
 
bool Ev2Der (double t, ON_3dPoint &point, ON_3dVector &first_derivative, ON_3dVector &second_derivative, int side=0, int *hint=0) const
 
bool EvaluatePoint (const class ON_ObjRef &objref, ON_3dPoint &P) const override
 virtual ON_Geometry override More...
 
bool EvCurvature (double t, ON_3dPoint &point, ON_3dVector &tangent, ON_3dVector &kappa, int side=0, int *hint=0) const
 
bool EvPoint (double t, ON_3dPoint &point, int side=0, int *hint=0) const
 
bool EvTangent (double t, ON_3dPoint &point, ON_3dVector &tangent, int side=0, int *hint=0) const
 
virtual bool Extend (const ON_Interval &domain)
 
bool FirstSpanIsLinear (double min_length, double tolerance) const
 
bool FirstSpanIsLinear (double min_length, double tolerance, ON_Line *span_line) const
 
bool FrameAt (double t, ON_Plane &plane) const
 
bool GetDomain (double *t0, double *t1) const
 curve interface More...
 
virtual bool GetSpanVectorIndex (double t, int side, int *span_vector_index, ON_Interval *span_domain) 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...
 
int IntersectCurve (const ON_Curve *curveB, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curveA_domain=0, const ON_Interval *curveB_domain=0) const
 
int IntersectPlane (ON_PlaneEquation plane_equation, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curve_domain=0) const
 
virtual int IntersectSelf (ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, const ON_Interval *curve_domain=0) const
 
int IntersectSurface (const ON_Surface *surfaceB, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curveA_domain=0, const ON_Interval *surfaceB_udomain=0, const ON_Interval *surfaceB_vdomain=0) const
 
bool IsArcAt (double t, const ON_Plane *plane=0, ON_Arc *arc=0, double tolerance=ON_ZERO_TOLERANCE, double *t0=0, double *t1=0) const
 
bool IsClosable (double tolerance, double min_abs_size=0.0, double min_rel_size=10.0) const
 
virtual bool IsEllipse (const ON_Plane *plane=nullptr, ON_Ellipse *ellipse=nullptr, double tolerance=ON_ZERO_TOLERANCE) const
 
bool LastSpanIsLinear (double min_length, double tolerance) const
 
bool LastSpanIsLinear (double min_length, double tolerance, ON_Line *span_line) const
 
bool LengthMassProperties (class ON_MassProperties &mp, bool bLength=true, bool bFirstMoments=true, bool bSecondMoments=true, bool bProductMoments=true, double rel_tol=1.0e-6, double abs_tol=1.0e-6) const
 
class ON_PolylineCurveMeshCurve (ON_MeshCurveParameters &mp, ON_PolylineCurve *polyline, bool bSkipFirstPoint, const ON_Interval *domain) const
 
ON_NurbsCurveNurbsCurve (ON_NurbsCurve *pNurbsCurve=nullptr, double tolerance=0.0, const ON_Interval *subdomain=nullptr) const
 
ON::object_type ObjectType () const override
 
ON_Curveoperator= (const ON_Curve &)
 
ON_3dPoint PointAt (double t) const
 
ON_3dPoint PointAtEnd () const
 
ON_3dPoint PointAtStart () const
 
virtual bool RemoveShortSegments (double tolerance, bool bRemoveShortSegments=true)
 
bool SetDomain (ON_Interval domain)
 
virtual bool SetEndPoint (ON_3dPoint end_point)
 
virtual bool SetStartPoint (ON_3dPoint start_point)
 
ON_3dVector TangentAt (double t) const
 
- Public Member Functions inherited from ON_Geometry
 ON_Geometry ()=default
 
 ON_Geometry (const ON_Geometry &)=default
 
 ~ON_Geometry ()=default
 
ON_BoundingBox BoundingBox () const
 
virtual class ON_BrepBrepForm (class ON_Brep *brep=nullptr) const
 
virtual void ClearBoundingBox ()
 
bool GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const
 
bool GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const
 
virtual bool HasBrepForm () const
 
virtual bool IsDeformable () const
 
virtual bool IsMorphable () const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
virtual bool MakeDeformable ()
 
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)
 
virtual bool SwapCoordinates (int i, int j)
 
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 ()
 
virtual ON_AggregateComponentStatus AggregateComponentStatus () const
 
bool AttachUserData (class ON_UserData *pUserData)
 
unsigned int ClearAllComponentStates () const
 
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
 
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) 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
 
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) 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 void MarkAggregateComponentStatusAsNotCurrent () const
 
virtual void MemoryRelocate ()
 
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 ()
 
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
 
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
 
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
 

Public Attributes

double m__legacy_2d_tol = ON_UNSET_VALUE
 used internally - ignore More...
 
double m__legacy_3d_tol = ON_UNSET_VALUE
 used internally - ignore More...
 
int m__legacy_flags = 0
 used internally - ignore More...
 
bool m_bRev3d = false
 true if the 2d trim and 3d edge have opposite orientations. More...
 
int m_c2i = -1
 index of the 2d parameter space trimming curve More...
 
int m_ei = -1
 index of 3d edge (-1 if ON_BrepTrim is singular) More...
 
ON_Surface::ISO m_iso = ON_Surface::not_iso
 
int m_li = -1
 index of loop that uses this trim More...
 
ON_BoundingBox m_pbox
 
ON_SimpleArray< ON_BrepTrimPointm_pline
 
ON_ComponentStatus m_status = ON_ComponentStatus::NoneSet
 
double m_tolerance [2]
 
int m_trim_index = -1
 index of trim in ON_Brep.m_T[] array More...
 
ON_U m_trim_user
 
TYPE m_type = ON_BrepTrim::unknown
 
int m_vi [2]
 

Friends

class ON_Brep
 

Additional Inherited Members

- Static Public Member Functions inherited from ON_Curve
static class ON_NurbsCurveCreateCubicLoft (int point_count, int point_dim, int point_stride, const double *point_list, double k, int is_closed=0, ON::cubic_loft_end_condition start_shape=ON::cubic_loft_ec_quadratic, ON::cubic_loft_end_condition end_shape=ON::cubic_loft_ec_quadratic, class ON_NurbsCurve *nurbs_curve=0)
 
- Static Public Attributes inherited from ON_Geometry
const static ON_Geometry Unset
 
- Protected Member Functions inherited from ON_CurveProxy
void SetProxyCurveIsReversed (bool bReversed)
 
- Protected Member Functions inherited from ON_Curve
bool ParameterSearch (double t, int &index, bool bEnableSnap, const ON_SimpleArray< double > &m_t, double RelTol=ON_SQRT_EPSILON) const
 

Detailed Description

Description: Brep trim information is stored in ON_BrepTrim classes. ON_Brep.m_T[] is an array of all the trim in the brep.

An ON_BrepTrim is derived from ON_CurveProxy so the the trim can supply easy to use evaluation tools via the ON_Curve virtual member functions.

Note well that the domains and orientations of the curve m_C2[trim.m_c2i] and the trim as a curve may not agree.

Member Enumeration Documentation

◆ TYPE

types of trim - access through m_type member. Also see m_iso and ON_Surface::ISO

Enumerator
unknown 
boundary 

trim is connected to an edge, is part of an outer, inner or slit loop, and is the only trim connected to the edge.

mated 

trim is connected to an edge, is part of an outer, inner or slit loop, no other trim from the same loop is connected to the edge, and at least one trim from a different loop is connected to the edge.

seam 

trim is connected to an edge, is part of an outer, inner or slit loop, and one other trim from the same loop is connected to the edge. (There can be other mated trims that are also connected to the edge. For example, the non-manifold edge that results when a surface edge lies in the middle of another surface.) Non-manifold "cuts" have seam trims too.

singular 

trim is part of an outer loop, the trim's 2d curve runs along the singular side of a surface, and the trim is NOT connected to an edge. (There is no 3d edge because the surface side is singular.)

crvonsrf 

trim is connected to an edge, is the only trim in a crfonsrf loop, and is the only trim connected to the edge.

ptonsrf 

trim is a point on a surface, trim.m_pbox is records surface parameters, and is the only trim in a ptonsrf loop. This trim is not connected to an edge and has no 2d curve.

slit 

17 Nov 2006 - reserved for future use currently an invalid value

trim_type_count 
force_32_bit_trim_type 

Constructor & Destructor Documentation

◆ ON_BrepTrim() [1/2]

ON_BrepTrim::ON_BrepTrim ( )

Construction

In general, you should not directly create ON_BrepTrim classes. Use ON_Brep::NewTrim instead.

◆ ON_BrepTrim() [2/2]

ON_BrepTrim::ON_BrepTrim ( int  )

trim index

Member Function Documentation

◆ AttachToEdge()

bool ON_BrepTrim::AttachToEdge ( int  edge_index,
bool  bRev3d 
)

Description: Expert user function. Attaches a trim to an edge. Parameters: edge_index - [in] index of an edge. bRev3d - [in] value for trim's m_bRev3d field. Remarks: If the trim is attached to an edge (m_ei>=0), then the trim is removed from the edge and the edge's m_ti[] list. The trim's tolerance values are not changed.

◆ Brep()

ON_Brep* ON_BrepTrim::Brep ( ) const

Returns: Brep that this trim belongs to.

◆ ChangeTrimCurve()

bool ON_BrepTrim::ChangeTrimCurve ( int  c2i)

Interface.

Not necessary Base class does the same. / virtual ON_Curve::SetStartPoint override bool SetStartPoint( ON_3dPoint start_point ) override;

/ virtual ON_Curve::SetEndPoint override bool SetEndPoint( ON_3dPoint end_point ) override; Description: Expert user tool that replaces the 2d curve geometry of a trim Parameters; c2i - [in] brep 2d curve index of new curve Returns: True if successful. Example:

      ON_Curve* pCurve = ...;
      int c2i = brep.AddTrimCurve(pCurve);
      trim.ChangeTrimCurve(c2i);

Remarks: Sets m_c2i, calls SetProxyCurve, cleans runtime caches, and updates m_pbox.

◆ ComponentIndex()

ON_COMPONENT_INDEX ON_BrepTrim::ComponentIndex ( ) const
overridevirtual

virtual ON_Geometry::ComponentIndex() override

Reimplemented from ON_Geometry.

◆ DestroyPspaceInformation()

void ON_BrepTrim::DestroyPspaceInformation ( )

Description: Destroy parameter space information. Currently, this involves destroying m_pline and m_pbox. Parameter space information should be destroyed when the location of a trim curve is changed.

◆ DestroyRuntimeCache()

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

Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

Reimplemented from ON_Object.

◆ Dump()

void ON_BrepTrim::Dump ( ON_TextLog ) const
overridevirtual

for debugging

Reimplemented from ON_Object.

◆ Edge()

ON_BrepEdge* ON_BrepTrim::Edge ( ) const

Returns: Brep edge this trim uses or belongs to. This will be nullptr for singular trims.

◆ EdgeCurveIndexOf()

int ON_BrepTrim::EdgeCurveIndexOf ( ) const

Returns: brep.m_C3[] 3d curve index of the 3d curve geometry used by this trim or -1.

◆ EdgeCurveOf()

const ON_Curve* ON_BrepTrim::EdgeCurveOf ( ) const

Returns: 3d curve geometry used by this trim or nullptr.

◆ Face()

ON_BrepFace* ON_BrepTrim::Face ( ) const

Returns: Brep face this trim belongs to.

◆ FaceIndexOf()

int ON_BrepTrim::FaceIndexOf ( ) const

Returns: brep.m_F[] face index of the face used by this trim or -1.

◆ Get3dVectorIntoFace()

bool ON_BrepTrim::Get3dVectorIntoFace ( double  trim_t,
ON_3dVector V,
ON_3dVector N 
) const

Description: At trim parameter trim_t, get the 3d unit vector in the surface tangent plane, perpendicular to the edge, which points into the active side of the trim. Parameters: trim_t - [in] parameter to trim at which to find the vector V - [out] the 3d vector N - [out] Surface normal at trim_t Returns: true if the vector can be found. False if edge tangent can't be computed or input is bad.

◆ IsSeam()

bool ON_BrepTrim::IsSeam ( ) const

Returns: True if the trim satisfies these four criteria. 1) is part of a loop 2) is connected to a 3d edge 3) one other trim from the same loop is connected to the edge 4) the 2d trim curve for this trim lies along the side of the face's parameter space and the 2d curve for the other trim lies on the opposite side of the face's parameter space. Remarks: In order for IsSeam() to work correctly, the m_type and m_iso fields must be set correctly. In V4 SR1, this function will be removed and ON_BrepTrim::slit will be added as a type.

◆ IsSlit()

bool ON_BrepTrim::IsSlit ( ) const

Returns: True if the trim satisfies these four criteria. 1) is part of a loop 2) is connected to a 3d edge 3) one other trim from the same loop is connected to the edge 4) The 2d trim curve for the other trim is the reverse of the 2d trim curve for this trim. Remarks: In order for IsSlit() to work correctly, the m_type and m_iso fields must be set correctly. In V4 SR1, this function will be removed and ON_BrepTrim::slit will be added as a type.

◆ IsValid()

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

ON_Object overrides

(Trims are purely topological - geometry queries should be directed at the trim's 2d curve or the trim's edge's 3d curve.)

Reimplemented from ON_Object.

◆ Loop()

ON_BrepLoop* ON_BrepTrim::Loop ( ) const

Returns: Brep loop that this trim belongs to.

◆ m__legacy_flags_Get()

bool ON_BrepTrim::m__legacy_flags_Get ( int *  ,
int *   
) const

used internally - ignore

◆ m__legacy_flags_Set()

void ON_BrepTrim::m__legacy_flags_Set ( int  ,
int   
)

values stored in legacy file formats - ignore

used internally - ignore

◆ operator=()

ON_BrepTrim& ON_BrepTrim::operator= ( const ON_BrepTrim )

◆ Read()

bool ON_BrepTrim::Read ( ON_BinaryArchive binary_archive)
overridevirtual

Description: Low level archive writing tool used by ON_BinaryArchive::ReadObject(). Parameters: binary_archive - archive to read from Returns: Returns true if the read is successful. Remarks: Use ON_BinaryArchive::ReadObject() to read objects. This Read() function should read the objects definition back into its data members.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

◆ RemoveFromEdge()

bool ON_BrepTrim::RemoveFromEdge ( bool  bRemoveFromStartVertex,
bool  bRemoveFromEndVertex 
)

Description: Expert user function. Removes a trim from an edge. Parameters: bRemoveFromStartVertex - [in] if true, the trim is removed from its start vertex by setting m_vi[0] to -1. bRemoveFromEndVertex - [in] if true, the trim is removed from its start vertex by setting m_vi[1] to -1. Remarks: If the trim is attached to an edge (m_ei>=0), then the trim is removed from the edge and the edge's m_ti[] list. The trim's m_bRev3d and tolerance values are not changed.

◆ Reverse()

bool ON_BrepTrim::Reverse ( )
overridevirtual

virtual ON_Curve::Reverse override Reverses curve - caller must make sure trim's m_bRev3d flags are properly updated. Use ON_Brep::FlipTrim to reverse and trim and update all m_bRev3d information.

Implements ON_Curve.

◆ SizeOf()

unsigned int ON_BrepTrim::SizeOf ( ) const
overridevirtual

virtual ON_Object::SizeOf override

Reimplemented from ON_Object.

◆ SurfaceIndexOf()

int ON_BrepTrim::SurfaceIndexOf ( ) const

Returns: brep.m_S[] surface index of the 3d surface geometry used by this trim or -1.

◆ SurfaceOf()

const ON_Surface* ON_BrepTrim::SurfaceOf ( ) const

Returns: 3d surface geometry used by this trim or nullptr

◆ TransformTrim()

bool ON_BrepTrim::TransformTrim ( const ON_Xform xform)

Description: Expert user tool that transforms all the parameter space (2d) trimming curves in this loop. Only 2d curve geometry is changed. The caller is responsible for reversing loops, toggle m_bRev, flags, etc. Parameters: xform - [in] Transformation applied to 2d curve geometry. Returns True if successful. If false is returned, the brep may be invalid.

◆ TrimCurveIndexOf()

int ON_BrepTrim::TrimCurveIndexOf ( ) const

Returns: brep.m_C2[] 2d curve index of the 2d curve geometry used by this trim or -1.

◆ TrimCurveOf()

const ON_Curve* ON_BrepTrim::TrimCurveOf ( ) const

Returns: 2d curve geometry used by this trim or nullptr

◆ UnsetPlineEdgeParameters()

void ON_BrepTrim::UnsetPlineEdgeParameters ( )

Description: When an edge is modified, the m_pline[].e values need to be set to ON_UNSET_VALUE by calling UnsetPlineEdgeParameters().

◆ Vertex()

ON_BrepVertex* ON_BrepTrim::Vertex ( int  tvi) const

Parameters: tvi - [in] 0 or 1 Returns: Brep vertex at specified end of the trim.

◆ Write()

bool ON_BrepTrim::Write ( ON_BinaryArchive binary_archive) const
overridevirtual

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

Friends And Related Function Documentation

◆ ON_Brep

friend class ON_Brep
friend

Member Data Documentation

◆ m__legacy_2d_tol

double ON_BrepTrim::m__legacy_2d_tol = ON_UNSET_VALUE

used internally - ignore

◆ m__legacy_3d_tol

double ON_BrepTrim::m__legacy_3d_tol = ON_UNSET_VALUE

used internally - ignore

◆ m__legacy_flags

int ON_BrepTrim::m__legacy_flags = 0

used internally - ignore

◆ m_bRev3d

bool ON_BrepTrim::m_bRev3d = false

true if the 2d trim and 3d edge have opposite orientations.

◆ m_c2i

int ON_BrepTrim::m_c2i = -1

index of the 2d parameter space trimming curve

◆ m_ei

int ON_BrepTrim::m_ei = -1

index of 3d edge (-1 if ON_BrepTrim is singular)

◆ m_iso

ON_Surface::ISO ON_BrepTrim::m_iso = ON_Surface::not_iso

◆ m_li

int ON_BrepTrim::m_li = -1

index of loop that uses this trim

◆ m_pbox

ON_BoundingBox ON_BrepTrim::m_pbox

Runtime parameter space trimming curve bounding box. This information is not saved in 3DM archives.

◆ m_pline

ON_SimpleArray<ON_BrepTrimPoint> ON_BrepTrim::m_pline

Runtime polyline approximation of trimming curve. This information is not saved in 3DM archives.

◆ m_status

ON_ComponentStatus ON_BrepTrim::m_status = ON_ComponentStatus::NoneSet
mutable

◆ m_tolerance

double ON_BrepTrim::m_tolerance[2]

The values in m_tolerance[] record the accuracy of the parameter space trimming curves.

Remarks: m_tolerance[0] = accuracy of parameter space curve in first ( "u" ) parameter

m_tolerance[1] = accuracy of parameter space curve in second ( "v" ) parameter

A value of ON_UNSET_VALUE indicates that the tolerance should be computed. If the value >= 0.0, then the tolerance is set. If the value is ON_UNSET_VALUE, then the tolerance needs to be computed.

If the trim is not singular, then the trim must have an edge. If P is a 3d point on the edge's curve and surface(u,v) = Q is the point on the surface that is closest to P, then there must be a parameter t in the interval [m_t[0], m_t[1]] such that

|u - curve2d(t)[0]| <= m_tolerance[0]

and

|v - curve2d(t)[1]| <= m_tolerance[1]

If P is the 3d point for the vertex brep.m_V[m_vi[k]] and (uk,vk) is the corresponding end of the trim's parameter space curve, then there must be a surface parameter (u,v) such that:

  • the distance from the 3d point surface(u,v) to P is <= brep.m_V[m_vi[k]].m_tolerance,
  • |u-uk| <= m_tolerance[0].
  • |v-vk| <= m_tolerance[1].

◆ m_trim_index

int ON_BrepTrim::m_trim_index = -1

index of trim in ON_Brep.m_T[] array

◆ m_trim_user

ON_U ON_BrepTrim::m_trim_user
mutable

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

◆ m_type

TYPE ON_BrepTrim::m_type = ON_BrepTrim::unknown

◆ m_vi

int ON_BrepTrim::m_vi[2]

Indices of start/end vertices. Trims along singular sides and trims that correspond to closed 3d edges have m_vi[0] = m_vi[1]. Note that singular trims and trims on the closed edge of a closed surface can have an open 2d trimming curve and still have m_vi[0] = m_vi[1].