Provides strongly-typed access to brep faces.

A Brep face is composed of one surface and trimming curves.

Hierarchy (view full)

Constructors

Properties

faceIndex: number

Index of face in Brep.Faces array.

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.

id: string

Gets or sets the persistent id of this Brep face. By default, the id is Guid.Zero. Note, Rhino does not set this id. Thus, the property is available for use as a way of tracking Brep faces.

isDeformable: boolean

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

isSolid: boolean

Gets a values indicating whether a surface is solid.

isSurface: boolean

Gets a value indicating whether the face is synonymous with the underlying surface. If a Face has no trimming curves then it is considered a Surface.

isValid: boolean

Tests an object to see if it is valid.

Loops in this face.

materialChannelIndex: number

This face's rendering material channel index.

objectType: ObjectType

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

orientationIsReversed: boolean

true if face orientation is opposite of natural surface orientation.

outerLoop: BrepLoop

Every face has a single outer loop.

perFaceColor: {
    a: number;
    b: number;
    g: number;
    r: number;
}

If per-face color is "Empty", then this face does not have a custom color

surfaceIndex: number

Surface index of the 3d surface geometry used by this face or -1

userStringCount: number

Gets the amount of user strings.

Methods

  • Gets the indices of all the BrepEdges that delineate this Face.

    Returns any[]

  • Gets the indices of all the BrepFaces that surround (are adjacent to) this face.

    Returns any[]

  • Clear this face's rendering material channel index.

    Returns void

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

  • Extrude a face in a Brep.

    Parameters

    • pathCurve: Curve

      The path to extrude along. Note, the direction of the extrusion will follow the direction of the curve.

    • cap: boolean

      If true, the extrusion is capped with a translation of the face being extruded

    Returns Brep

    A Brep on success or null on failure.

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

  • Returns the maximum algebraic degree of any span (or a good estimate if curve spans are not algebraic).

    Parameters

    • direction: number

      0 gets first parameter's domain, 1 gets second parameter's domain.

    Returns number

    The maximum degree.

  • Gets the domain in a direction.

    Parameters

    • direction: number

      0 gets first parameter, 1 gets second parameter.

    Returns Interval

    An interval value.

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

    Returns GeometryBase

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

  • Duplicate a face from the brep to create new single face brep.

    Parameters

    • duplicateMeshes: boolean

      If true, shading meshes will be copied as well.

    Returns Brep

    A new single-face brep synonymous with the current Face.

  • Gets a copy to the untrimmed surface that this face is based on.

    Returns Surface

    A copy of this face's underlying surface.

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

  • Evaluates a surface mathematically.

    The partial derivatives will be in the order {Su, Sv} for numberDerivatives = 1, {Su, Sv, Suu, Suv, Svv} for 2, {Su, Sv, Suu, Suv, Svv, Suuu, Suuv, Suvv, Svvv} for 3, and similar for higher counts.

    Parameters

    • u: number

      A U parameter.

    • v: number

      A V parameter.

    • numberDerivatives: number

      The number of derivatives.

    Returns [boolean, Point3d, Vector3d[]]

    true if the operation succeeded; false otherwise.

  • Analytically extends the surface to include the interval.

    Parameters

    • direction: number

      If 0, Surface.Domain(0) will include the interval. (the first surface parameter). If 1, Surface.Domain(1) will include the interval. (the second surface parameter).

    • interval: Interval

      If the interval is not included in surface domain, the surface will be extended so that its domain includes the interval. Note, this method will fail if the surface is closed in the specified direction.

    Returns boolean

    True if successful, false otherwise.

  • Computes the orient plane on a surface given a U and V parameter.

    This is the simple evaluation call with no error handling.

    Parameters

    • u: number

      A first parameter.

    • v: number

      A second parameter.

    Returns [boolean, Plane]

    true if this operation succeeded; otherwise false.

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

  • Obtains a reference to a specified type of mesh for this brep face.

    Parameters

    Returns Mesh

    A mesh.

  • Searches for a derivative, tangent, or curvature discontinuity.

    Parameters

    • direction: number

      If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked.

    • continuityType: Continuity

      The desired continuity.

    • t0: number

      Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities.

    • t1: number

      (t0 != t1) If there is a discontinuity at t1 is will be ignored unless c is a locus discontinuity type and t1 is at the start or end of the curve.

    • cosAngleTolerance: number

      default = cos(1 degree) Used only when continuityType is G1_continuous or G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported.

    • curvatureTolerance: number

      (default = ON_SQRT_EPSILON) Used only when continuityType is G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported.

    Returns [boolean, number]

    Parametric continuity tests c = (C0_continuous, ..., G2_continuous): TRUE if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains. Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous): TRUE if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

  • Searches for a derivative, tangent, or curvature discontinuity.

    Parameters

    • direction: number

      If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked.

    • continuityType: Continuity

      The desired continuity.

    • t0: number

      Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities.

    • t1: number

      (t0 != t1) If there is a discontinuity at t1 is will be ignored unless c is a locus discontinuity type and t1 is at the start or end of the curve.

    Returns [boolean, number]

    Parametric continuity tests c = (C0_continuous, ..., G2_continuous): TRUE if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains. Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous): TRUE if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

  • Translates a parameter from the current surface to the parameter space of the surface returned by ToNurbsSurface.

    Parameters

    • surfaceS: number

      The parameter in the S, or sometimes U, direction, of this surface.

    • surfaceT: number

      The parameter in the T, or sometimes V, direction of this surface.

    Returns [boolean, number, number]

    True if the operation succeeded; otherwise, false.

  • Gets array of span "knots".

    Parameters

    • direction: number

      0 gets first parameter's domain, 1 gets second parameter's domain.

    Returns number[]

    An array with span vectors; or null on error.

  • Translates a parameter from a value on the surface returned by ToNurbsSurface to the current surface.

    Parameters

    • nurbsS: number

      The parameter in the S, or sometimes U, direction of the NURBS form surface.

    • nurbsT: number

      The parameter in the T, or sometimes V, direction of the NURBS form surface.

    Returns [boolean, number, number]

    True if the operation succeeded; otherwise, false.

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

  • Is there a NURBS surface representation of this surface.

    Returns number

    0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transcendental parameterization like spheres, cylinders, and cones.

  • Tests if a surface parameter value is at a seam.

    Parameters

    • u: number

      Surface u parameter to test.

    • v: number

      Surface v parameter to test.

    Returns number

    0 if not a seam, 1 if u == Domain(0)[i] and srf(u, v) == srf(Domain(0)[1-i], v) 2 if v == Domain(1)[i] and srf(u, v) == srf(u, Domain(1)[1-i]) 3 if 1 and 2 are true.

  • Tests if a surface parameter value is at a singularity.

    Parameters

    • u: number

      Surface u parameter to test.

    • v: number

      Surface v parameter to test.

    • exact: boolean

      If true, test if (u,v) is exactly at a singularity. If false, test if close enough to cause numerical problems.

    Returns boolean

    true if surface is singular at (s,t)

  • Gets a value indicating if the surface is closed in a direction.

    Parameters

    • direction: number

      0 = U, 1 = V.

    Returns boolean

    The indicating boolean value.

  • Determines if the surface is a portion of a cone within a given tolerance.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns boolean

    true if the surface is a portion of a cone.

  • Determines if the surface is a portion of a cone within RhinoMath.ZeroTolerance.

    Returns boolean

    true if the surface is a portion of a cone.

  • Tests continuity at a surface parameter value.

    Parameters

    • continuityType: Continuity

      The continuity type to sample.

    • u: number

      Surface u parameter to test.

    • v: number

      Surface v parameter to test.

    Returns boolean

    true if the surface has at least the specified continuity at the (u,v) parameter.

  • Determines if the surface is a portion of a cylinder within a given tolerance.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns boolean

    true if the surface is a portion of a cylinder.

  • Determines if the surface is a portion of a cylinder within RhinoMath.ZeroTolerance.

    Returns boolean

    true if the surface is a portion of a cylinder.

  • Determines if the surface is a portion of an extrusion within a given tolerance.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns boolean

    true if the surface is an extrusion.

  • Determines if the surface is a portion of an extrusion within RhinoMath.ZeroTolerance.

    Returns boolean

    true if the surface is an extrusion.

  • Determines if a 2d bounding box is isoparametric in the parameter space of this surface.

    Parameters

    Returns IsoStatus

    IsoStatus flag describing the iso-parametric relationship between the surface and the bounding box.

  • Determines if a 2D curve is isoparametric in the parameter space of this surface.

    Parameters

    • curve: Curve

      Curve to test.

    • curveDomain: Interval

      Sub domain of the curve.

    Returns IsoStatus

    IsoStatus flag describing the iso-parametric relationship between the surface and the curve.

  • Determines if a 2d curve is isoparametric in the parameter space of this surface.

    Parameters

    • curve: Curve

      Curve to test.

    Returns IsoStatus

    IsoStatus flag describing the iso-parametric relationship between the surface and the curve.

  • Gets isoparametric curve that corresponds to one of the four surface edges. Other IsoStatus values are not supported.

    Parameters

    • iso: IsoStatus

      IsoStatus.North returns the curve where U varies and V is V_max IsoStatus.East returns the curve where V varies and U is U_max IsoStatus.South returns the curve where U varies and V is V_min IsoStatus.West returns the curve where V varies and U is U_min

    Returns Curve

    An isoparametric curve or null on error.

  • Gets isoparametric curve. IsoStatus.None is not supported, and IsoStatus.X and IsoStatus.Y need valid t-values in the U- or V-domain respectively.

    Parameters

    • iso: IsoStatus

      IsoStatus.North returns the curve where U varies and V is V_max (paramter t is ignored) IsoStatus.East returns the curve where V varies and U is U_max (paramter t is ignored) IsoStatus.South returns the curve where U varies and V is V_min (paramter t is ignored) IsoStatus.West returns the curve where V varies and U is U_min (paramter t is ignored) IsoStatus.X returns the curve where V varies and U is t (if t is inside the U-domain) IsoStatus.Y returns the curve where U varies and V is t (if t is inside the V-domain)

    • t: number

      the parameter used if iso is X or Y.

    Returns Curve

    An isoparametric curve or null on error.

  • Gets isoparametric curve.

    In this function "direction" indicates which direction the resulting curve runs. 0: horizontal, 1: vertical In the other Surface functions that take a "direction" argument, "direction" indicates if "constantParameter" is a "u" or "v" parameter.

    Parameters

    • direction: number

      0 first parameter varies and second parameter is constant e.g., point on IsoCurve(0,c) at t is srf(t,c) This is a horizontal line from left to right 1 first parameter is constant and second parameter varies e.g., point on IsoCurve(1,c) at t is srf(c,t This is a vertical line from bottom to top.

    • constantParameter: number

      The parameter that was constant on the original surface.

    Returns Curve

    An isoparametric curve or null on error.

  • Gets a value indicating if the surface is periodic in a direction (default is false).

    Parameters

    • direction: number

      0 = U, 1 = V.

    Returns boolean

    The indicating boolean value.

  • Tests a surface to see if it is planar to a given tolerance.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns boolean

    true if there is a plane such that the maximum distance from the surface to the plane is <= tolerance.

  • Tests a surface to see if it is planar to zero tolerance.

    Returns boolean

    true if the surface is planar (flat) to within RhinoMath.ZeroTolerance units (1e-12).

  • true if surface side is collapsed to a point.

    Parameters

    • side: number

      side of parameter space to test 0 = south, 1 = east, 2 = north, 3 = west.

    Returns boolean

    True if this specific side of the surface is singular; otherwise, false.

  • Determines if the surface is a portion of a sphere within a given tolerance.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns boolean

    true if the surface is a portion of a sphere.

  • Determines if the surface is a portion of a sphere within RhinoMath.ZeroTolerance.

    Returns boolean

    true if the surface is a portion of a sphere.

  • Determines if the surface is a portion of a torus within a given tolerance.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns boolean

    true if the surface is a portion of a torus.

  • Determines if the surface is a portion of a torus within RhinoMath.ZeroTolerance.

    Returns boolean

    true if the surface is a portion of a torus.

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

  • Computes the surface normal at a point.

    This is the simple evaluation call - it does not support error handling.

    Parameters

    • u: number

      A U parameter.

    • v: number

      A V parameter.

    Returns Vector3d

    The normal.

  • Evaluates a point at a given parameter.

    Parameters

    • u: number

      evaluation parameters.

    • v: number

      evaluation parameters.

    Returns Point3d

    Point3d.Unset on failure.

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

    Returns string

    The XML text, empty when the object has none.

  • Reverses parameterization Domain changes from [a,b] to [-b,-a]

    Parameters

    • direction: number

      0 for first parameter's domain, 1 for second parameter's domain.

    Returns Surface

    a new reversed surface on success.

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

  • Sets the domain in a direction.

    Parameters

    • direction: number

      0 sets first parameter's domain, 1 sets second parameter's domain.

    • domain: Interval

      A new domain to be assigned.

    Returns boolean

    true if setting succeeded, otherwise false.

  • Sets a reference to a specified type of mesh for this brep face.

    Parameters

    Returns boolean

    true if the operation succeeded; otherwise false.

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

  • Shrinks the underlying untrimmed surface of this Brep face close to trimming boundaries. Shrinking a surface is like extending smoothly, only backwards. knot of full multiplicity are added where you want the surface to be cut off. Then the remaining control points are thrown away.

    Parameters

    Returns boolean

    true on success, false on failure.

  • Gets number of smooth nonempty spans in the parameter direction.

    Parameters

    • direction: number

      0 gets first parameter's domain, 1 gets second parameter's domain.

    Returns number

    The span count.

  • Converts the surface into a Brep.

    Returns Brep

    A Brep with a similar shape like this surface or null.

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

    Parameters

    • Optionalkey: any

    Returns Record<string, any>

  • Gets a NURBS surface representation of this surface.

    Parameters

    • tolerance: number

      tolerance to use when creating NURBS representation.

    Returns [NurbsSurface, number]

    NurbsSurface on success, null on failure.

  • Gets a NURBS surface representation of this surface. Default tolerance of 0.0 is used.

    Returns NurbsSurface

    NurbsSurface on success, null on failure.

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

  • Transposes surface parameterization (swap U and V)

    Returns Surface

    New transposed surface on success, null on failure.

  • Tests a surface to see if it is a portion of a cone and returns the cone.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns [boolean, Cone]

    true if the surface is a portion of a cone.

  • Tests a surface to see if it is a portion of a cone within RhinoMath.ZeroTolerance and return the cone.

    Returns [boolean, Cone]

    true if the surface is a portion of a cone.

  • Tests a surface to see if it is a portion of a cylinder and return the infinite cylinder.

    If successful, an infinite cylinder is returned. When a surface has a cylindrical shape, even if its ends are not circles on the cylinder, it returns the axis and radius. You can detect infinite cylinders using Cylinder.IsFinite.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns [boolean, Cylinder]

    true if the surface is a portion of a cylinder.

  • Tests a surface to see if it is a portion of a cylinder within RhinoMath.ZeroTolerance and return the cylinder.

    If successful, an infinite cylinder is returned. When a surface has a cylindrical shape, even if its ends are not circles on the cylinder, it returns the axis and radius. You can detect infinite cylinders using Cylinder.IsFinite.

    Returns [boolean, Cylinder]

    true if the surface is a portion of a cylinder.

  • Tests a surface with the assumption that it might be a right circular cylinder and returns this geometry.

    If successful, a finite cylinder is returned.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns [boolean, Cylinder]

    true if the surface is a portion of a cylinder.

  • Tests a surface for planarity and return the plane.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns [boolean, Plane]

    true if there is a plane such that the maximum distance from the surface to the plane is <= tolerance.

  • Tests a surface for planarity and return the plane.

    Returns [boolean, Plane]

    true if there is a plane such that the maximum distance from the surface to the plane is <= RhinoMath.ZeroTolerance.

  • Test a surface to see if it is a portion of a sphere and return the sphere.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns [boolean, Sphere]

    true if the surface is a portion of a sphere.

  • Test a surface to see if it is a portion of a sphere and return the sphere.

    Returns [boolean, Sphere]

    true if the surface is a portion of a sphere.

  • Tests a surface to see if it is a portion of a torus and returns the torus.

    Parameters

    • tolerance: number

      tolerance to use when checking.

    Returns [boolean, Torus]

    true if the surface is a portion of a torus.

  • Tests a surface to see if it is a portion of a torus within RhinoMath.ZeroTolerance and returns the torus.

    Returns [boolean, Torus]

    true if the surface is a portion of a torus.

  • Gets the untrimmed surface that is the base of this face.

    Returns Surface

    A surface, or null on error.

  • 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