Represent a single loop in a Brep object. A loop is composed of a list of trim curves.

Hierarchy (view full)

Constructors

Properties

face: BrepFace

BrepFace this loop belongs to.

hasBrepForm: boolean

Returns true if the Brep.TryConvertBrep function will be successful for this object

hasUserData: boolean

Gets true if this class has any custom information attached to it through UserData.

isDeformable: boolean

true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.

isSurfaceBoundary: boolean

True if the loop's trims all run along the edge's of the underlying surface's parameter space.

isValid: boolean

Tests an object to see if it is valid.

loopIndex: number

Gets the index of this loop in the Brep.Loops collection.

loopType: BrepLoopType

type of loop.

objectType: ObjectType

Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.

List of trims for this loop

userStringCount: number

Gets the amount of user strings.

Methods

  • If this piece of geometry is a component in something larger, like a BrepEdge in a Brep, then this function returns the component index.

    Returns ComponentIndex

    This object's component index. If this object is not a sub-piece of a larger geometric entity, then the returned index has m_type = ComponentIndex.InvalidType and m_index = -1.

  • Returns a CRC calculated from the information that defines the object. This CRC can be used as a quick way to see if two objects are not identical.

    Parameters

    • currentRemainder: number

      The current remainder value.

    Returns number

    CRC of the information the defines the object.

  • Constructs a deep (full) copy of this object.

    Returns GeometryBase

    An object of the same type as this, with the same properties and behavior.

  • This object as a JSON-compatible dict (rhino3dm only; inverse: Decode).

    Returns Record<string, any>

    A dict of numbers and strings: geometry and other objects are stored as their 3dm archive, base64 encoded, with the archive version.

  • Aligned Bounding box solver. Gets the world axis aligned bounding box for the transformed geometry.

    Parameters

    • xform: Transform

      Transformation to apply to object prior to the BoundingBox computation. The geometry itself is not modified.

    Returns BoundingBox

    The accurate bounding box of the transformed geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

  • Aligned Bounding box solver. Gets the plane aligned bounding box.

    Parameters

    • plane: Plane

      Orientation plane for BoundingBox.

    Returns BoundingBox

    A BoundingBox in plane coordinates.

  • Bounding box solver. Gets the world axis aligned bounding box for the geometry.

    Parameters

    • accurate: boolean

      If true, a physically accurate bounding box will be computed. If not, a bounding box estimate will be computed. For some geometry types there is no difference between the estimate and the accurate bounding box. Estimated bounding boxes can be computed much (much) faster than accurate (or "tight") bounding boxes. Estimated bounding boxes are always similar to or larger than accurate bounding boxes.

    Returns BoundingBox

    The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

  • Gets user string from this geometry.

    Parameters

    • key: string

      id used to retrieve the string.

    Returns string

    string associated with the key if successful. null if no key was found.

  • Gets a copy of all (user key string, user value string) pairs attached to this geometry.

    Returns any[]

    A new collection.

  • Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.

    Returns [boolean, string]

    true if this object is valid; false otherwise.

  • If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.

    Returns boolean

    false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.

  • Computes an estimate of the number of bytes that this object is using in memory.

    Returns number

    An estimated memory footprint.

  • The object's render data (RDK) as XML (rhino3dm only).

    Returns string

    The XML text, empty when the object has none.

  • Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).

    Parameters

    • angleRadians: number

      Angle of rotation in radians.

    • rotationAxis: Vector3d

      Direction of the axis of rotation.

    • rotationCenter: Point3d

      Point on the axis of rotation.

    Returns boolean

    true if geometry successfully rotated.

  • Scales the object by the specified factor. The scale is centered at the origin.

    Parameters

    • scaleFactor: number

      The uniform scaling factor.

    Returns boolean

    true if geometry successfully scaled.

  • Attach a user string (key,value combination) to this geometry.

    Parameters

    • key: string

      id used to retrieve this string.

    • value: string

      string associated with key.

    Returns boolean

    true on success.

  • Create a 2d curve that traces the entire loop

    Returns Curve

  • Create a 3D curve that approximates the loop geometry.

    Returns Curve

    A 3D curve that approximates the loop or null on failure.

  • encode()'s object, for JSON.stringify (JS only).

    Parameters

    • Optionalkey: any

    Returns Record<string, any>

  • Transforms the geometry. If the input Transform has a SimilarityType of OrientationReversing, you may want to consider flipping the transformed geometry after calling this function when it makes sense. For example, you may want to call Flip() on a Brep after transforming it.

    Parameters

    • xform: Transform

      Transformation to apply to geometry.

    Returns boolean

    true if geometry successfully transformed.

  • Translates the object along the specified vector.

    Parameters

    • translationVector: Vector3d

      A moving vector.

    Returns boolean

    true if geometry successfully translated.

  • Translates the object along the specified vector.

    Parameters

    • x: number

      The X component.

    • y: number

      The Y component.

    • z: number

      The Z component.

    Returns boolean

    true if geometry successfully translated.

  • Computes an estimate of the number of bytes that this object is using in memory.

    This is the same as calling GeometryBase.MemoryEstimate, but works for all CommonObject derived classes.

    Parameters

    Returns number

    An estimated memory footprint.

  • The object a dict from Encode describes (rhino3dm only).

    Parameters

    • jsonObject: Record<string, any>

      A dict as Encode returns it.

    Returns CommonObject