SurfaceLocus
References[IoId("00000000-c694-461a-80c6-88f84488325b")]
public sealed class SurfaceLocus : IStorable, IEquatable<SurfaceLocus>, IComparable<SurfaceLocus>
Represents a parameter or locus on or near a surface. This type replaces the simple (u,v) surface parameters as used in RhinoCommon and Grasshopper 1.0 with a more flexible and forgiving approach.
The Kind says exactly how the coordinates and the indices are to be read; no meaning is hidden inside the index array. Every parametric locus stores two coordinates and every point three. Kinds which need fewer, SubD edges and vertices, pad the remainder with zeroes so that UV means something no matter which kind it is asked of.
Constructors
SurfaceLocus
#Create a surface locus from first principles. Consider one of the static creation methods to ensure your loci are valid.
Parameters:
| kind (SurfaceLocusKind) | Kind. |
| coordinates (double[]) | Array of coordinates. |
| indices (int[]) | Array of indices. |
Fields
Properties
Kind
#Gets the kind of locus this is. The value may be one which this version of Grasshopper does not know, either because it was defined by a plug-in or because it was written by a newer version.
UV
#Gets the UV coordinate embedded in this locus. This is only meaningful if Kind is a parametric kind.
XYZ
#Gets the 3D coordinate embedded in this locus. This is only meaningful if Kind equals SurfaceLocusKind.Point.
Methods
Coordinate
#Gets the specified coordinate. If the index exceeds the coordinate array, zero will be returned.
Parameters:
| index (int) |
FromIntrinsic
#Create a surface locus from a uv parameter pair measured in the parameter space of a single indexed face.
FromIntrinsic
#Create a surface locus from a uv parameter pair measured in the parameter space of the surface itself.
Parameters:
| parameter (Point2d) |
FromNormalised
#Create a surface locus from a uv parameter pair in the normalised (0,1) space of a single indexed face.
FromNormalised
#Create a surface locus from a uv parameter pair in normalised (0,1) space.
Parameters:
| parameter (Point2d) |
FromSubDParameter
#Create a surface locus from a native SubD surface parameter.
SubDs have no global (u,v) parameterisation, so a SubD locus addresses a face, an edge or a vertex by id, and stores whatever parameters that component needs.
Parameters:
| parameter (SubDComponentParameter) | A component parameter on a SubD. |
Returns: A locus that resolves natively on the SubD, or Unset if the parameter addresses no component at all.
IndexAt
#Gets the specified index. If the index exceeds the index array, -1 will be returned.
Parameters:
| index (int) |
ResolveToParameter
#ResolveToParameter
#ResolveToParameter
#ResolveToParameter
#ResolveToParameter
#Resolve this locus to a native SubD component parameter.
Point loci are resolved with SubD closest point, and the three SubD kinds resolve exactly. A (u,v) parameter with a face index was probably meant for a brep, but it is interpreted as best it can be.
Parameters:
| subd (SubD) | SubD to resolve against. |
| parameter (out SubDComponentParameter) | Resolved parameter, or SubDComponentParameter.Unset. |
Returns: True if a parameter was resolved.
ResolveToParameter
#ResolveToParameter
#Convertors
| Operation | Result | Description | ||
|---|---|---|---|---|
| implicit | Point2d | SurfaceLocus | Create a surface locus from a parameter. | |
| implicit | Point3d | SurfaceLocus | Create a surface locus from a point. | |