```
///
``````
///
``````
///
```

```
public static Brep CreateEdgeSurface(IEnumerable
``` curves)
{
return ComputeServer.Post(ApiAddress(), curves);
}
///
/// Constructs a set of planar Breps as outlines by the loops.
///
/// Curve loops that delineate the planar boundaries.
/// An array of Planar Breps or null on error.
public static Brep[] CreatePlanarBreps(Rhino.Collections.CurveList inputLoops)
{
return ComputeServer.Post(ApiAddress(), inputLoops);
}
///
/// Constructs a set of planar Breps as outlines by the loops.
///
/// Curve loops that delineate the planar boundaries.
///
/// An array of Planar Breps.
public static Brep[] CreatePlanarBreps(Rhino.Collections.CurveList inputLoops, double tolerance)
{
return ComputeServer.Post(ApiAddress(), inputLoops, tolerance);
}
///
/// Offsets a face including trim information to create a new brep.
///
/// the face to offset.
/// An offset distance.
///
/// Use 0.0 to make a loose offset. Otherwise, the document's absolute tolerance is usually sufficient.
///
/// When true, offset to both sides of the input face.
/// When true, make a solid object.
///
/// A new brep if successful. The brep can be disjoint if bothSides is true and createSolid is false,
/// or if createSolid is true and connecting the offsets with side surfaces fails.
/// null if unsuccessful.
///
public static Brep CreateFromOffsetFace(BrepFace face, double offsetDistance, double offsetTolerance, bool bothSides, bool createSolid)
{
return ComputeServer.Post(ApiAddress(), face, offsetDistance, offsetTolerance, bothSides, createSolid);
}
///
/// Constructs closed polysurfaces from surfaces and polysurfaces that bound a region in space.
///
///
/// The intersecting surfaces and polysurfaces to automatically trim and join into closed polysurfaces.
///
///
/// The trim and join tolerance. If set to RhinoMath.UnsetValue, Rhino's global absolute tolerance is used.
///
/// The resulting polysurfaces on success or null on failure.
public static Brep[] CreateSolid(IEnumerable breps, double tolerance)
{
return ComputeServer.Post(ApiAddress(), breps, tolerance);
}
///
/// Merges two surfaces into one surface at untrimmed edges.
///
/// The first surface to merge.
/// The second surface to merge.
/// Surface edges must be within this tolerance for the two surfaces to merge.
/// Edge must be within this angle tolerance in order for contiguous edges to be combined into a single edge.
/// The merged surfaces as a Brep if successful, null if not successful.
public static Brep MergeSurfaces(Surface surface0, Surface surface1, double tolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), surface0, surface1, tolerance, angleToleranceRadians);
}
///
/// Merges two surfaces into one surface at untrimmed edges. Both surfaces must be untrimmed and share an edge.
///
/// The first single-face Brep to merge.
/// The second single-face Brep to merge.
/// Surface edges must be within this tolerance for the two surfaces to merge.
/// Edge must be within this angle tolerance in order for contiguous edges to be combined into a single edge.
/// The merged Brep if successful, null if not successful.
public static Brep MergeSurfaces(Brep brep0, Brep brep1, double tolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), brep0, brep1, tolerance, angleToleranceRadians);
}
///
/// Merges two surfaces into one surface at untrimmed edges. Both surfaces must be untrimmed and share an edge.
///
/// The first single-face Brep to merge.
/// The second single-face Brep to merge.
/// Surface edges must be within this tolerance for the two surfaces to merge.
/// Edge must be within this angle tolerance in order for contiguous edges to be combined into a single edge.
/// 2D pick point on the first single-face Brep. The value can be unset.
/// 2D pick point on the second single-face Brep. The value can be unset.
/// Defines the roundness of the merge. Acceptable values are between 0.0 (sharp) and 1.0 (smooth).
/// The surface will be smooth. This makes the surface behave better for control point editing, but may alter the shape of both surfaces.
/// The merged Brep if successful, null if not successful.
public static Brep MergeSurfaces(Brep brep0, Brep brep1, double tolerance, double angleToleranceRadians, Point2d point0, Point2d point1, double roundness, bool smooth)
{
return ComputeServer.Post(ApiAddress(), brep0, brep1, tolerance, angleToleranceRadians, point0, point1, roundness, smooth);
}
///
/// Constructs a brep patch.
/// This is the simple version of fit that uses a specified starting surface.
///
///
/// Combination of Curves, BrepTrims, Points, PointClouds or Meshes.
/// Curves and trims are sampled to get points. Trims are sampled for
/// points and normals.
///
/// A starting surface (can be null).
///
/// Tolerance used by input analysis functions for loop finding, trimming, etc.
///
///
/// Brep fit through input on success, or null on error.
///
public static Brep CreatePatch(IEnumerable geometry, Surface startingSurface, double tolerance)
{
return ComputeServer.Post(ApiAddress(), geometry, startingSurface, tolerance);
}
///
/// Constructs a brep patch.
/// This is the simple version of fit that uses a plane with u x v spans.
/// It makes a plane by fitting to the points from the input geometry to use as the starting surface.
/// The surface has the specified u and v span count.
///
///
/// A combination of curves , brep trims,
/// points , point clouds or meshes .
/// Curves and trims are sampled to get points. Trims are sampled for
/// points and normals.
///
/// The number of spans in the U direction.
/// The number of spans in the V direction.
///
/// Tolerance used by input analysis functions for loop finding, trimming, etc.
///
///
/// A brep fit through input on success, or null on error.
///
public static Brep CreatePatch(IEnumerable geometry, int uSpans, int vSpans, double tolerance)
{
return ComputeServer.Post(ApiAddress(), geometry, uSpans, vSpans, tolerance);
}
///
/// Constructs a brep patch using all controls
///
///
/// A combination of curves , brep trims,
/// points , point clouds or meshes .
/// Curves and trims are sampled to get points. Trims are sampled for
/// points and normals.
///
/// A starting surface (can be null).
///
/// Number of surface spans used when a plane is fit through points to start in the U direction.
///
///
/// Number of surface spans used when a plane is fit through points to start in the U direction.
///
///
/// If true, try to find an outer loop from among the input curves and trim the result to that loop
///
///
/// If true, try to find brep trims in the outer loop of curves and try to
/// fit to the normal direction of the trim's surface at those locations.
///
///
/// Basic distance between points sampled from input curves.
///
///
/// Determines the behavior of the surface in areas where its not otherwise
/// controlled by the input. Lower numbers make the surface behave more
/// like a stiff material; higher, less like a stiff material. That is,
/// each span is made to more closely match the spans adjacent to it if there
/// is no input geometry mapping to that area of the surface when the
/// flexibility value is low. The scale is logrithmic. Numbers around 0.001
/// or 0.1 make the patch pretty stiff and numbers around 10 or 100 make the
/// surface flexible.
///
///
/// Tends to keep the result surface where it was before the fit in areas where
/// there is on influence from the input geometry
///
///
/// Array of four elements. Flags to keep the edges of a starting (untrimmed)
/// surface in place while fitting the interior of the surface. Order of
/// flags is left, bottom, right, top
///
///
/// Tolerance used by input analysis functions for loop finding, trimming, etc.
///
///
/// A brep fit through input on success, or null on error.
///
public static Brep CreatePatch(IEnumerable geometry, Surface startingSurface, int uSpans, int vSpans, bool trim, bool tangency, double pointSpacing, double flexibility, double surfacePull, bool[] fixEdges, double tolerance)
{
return ComputeServer.Post(ApiAddress(), geometry, startingSurface, uSpans, vSpans, trim, tangency, pointSpacing, flexibility, surfacePull, fixEdges, tolerance);
}
///
/// Creates a single walled pipe
///
/// the path curve for the pipe
/// radius of the pipe
///
/// If True, Local (pipe radius stays constant at the ends and changes more rapidly in the middle) is applied.
/// If False, Global (radius is linearly blended from one end to the other, creating pipes that taper from one radius to the other) is applied
///
/// end cap mode
///
/// If the curve is a polycurve of lines and arcs, the curve is fit and a single surface is created;
/// otherwise the result is a polysurface with joined surfaces created from the polycurve segments.
///
///
/// The sweeping and fitting tolerance. If you are unsure what to use, then use the document's absolute tolerance
///
///
/// The angle tolerance. If you are unsure what to use, then either use the document's angle tolerance in radians
///
/// Array of created pipes on success
public static Brep[] CreatePipe(Curve rail, double radius, bool localBlending, PipeCapMode cap, bool fitRail, double absoluteTolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), rail, radius, localBlending, cap, fitRail, absoluteTolerance, angleToleranceRadians);
}
///
/// Creates a single walled pipe
///
/// the path curve for the pipe
///
/// one or more normalized curve parameters where changes in radius occur.
/// Important: curve parameters must be normalized - ranging between 0.0 and 1.0.
///
/// An array of radii - one at each normalized curve parameter in railRadiiParameters.
///
/// If True, Local (pipe radius stays constant at the ends and changes more rapidly in the middle) is applied.
/// If False, Global (radius is linearly blended from one end to the other, creating pipes that taper from one radius to the other) is applied
///
/// end cap mode
///
/// If the curve is a polycurve of lines and arcs, the curve is fit and a single surface is created;
/// otherwise the result is a polysurface with joined surfaces created from the polycurve segments.
///
///
/// The sweeping and fitting tolerance. If you are unsure what to use, then use the document's absolute tolerance
///
///
/// The angle tolerance. If you are unsure what to use, then either use the document's angle tolerance in radians
///
/// Array of created pipes on success
public static Brep[] CreatePipe(Curve rail, IEnumerable railRadiiParameters, IEnumerable radii, bool localBlending, PipeCapMode cap, bool fitRail, double absoluteTolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), rail, railRadiiParameters, radii, localBlending, cap, fitRail, absoluteTolerance, angleToleranceRadians);
}
///
/// Sweep1 function tht fits a surface through a profile curve that define the surface cross-sections
/// and one curve that defines a surface edge.
/// ///
/// Rail to sweep shapes along
/// Shape curve
/// Only matters if shape is closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
///
/// If you are not producing the sweep results that you are after, then
/// use the SweepOneRail class with options to generate the swept geometry.
///
public static Brep[] CreateFromSweep(Curve rail, Curve shape, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail, shape, closed, tolerance);
}
///
/// Sweep1 function tht fits a surface through a profile curve that define the surface cross-sections
/// and one curve that defines a surface edge.
///
/// Rail to sweep shapes along
/// Shape curves
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
///
/// If you are not producing the sweep results that you are after, then
/// use the SweepOneRail class with options to generate the swept geometry.
///
public static Brep[] CreateFromSweep(Curve rail, IEnumerable shapes, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail, shapes, closed, tolerance);
}
///
/// General 2 rail sweep. If you are not producing the sweep results that you are after, then
/// use the SweepTwoRail class with options to generate the swept geometry
///
/// Rail to sweep shapes along
/// Rail to sweep shapes along
/// Shape curve
/// Only matters if shape is closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweep(Curve rail1, Curve rail2, Curve shape, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail1, rail2, shape, closed, tolerance);
}
///
/// General 2 rail sweep. If you are not producing the sweep results that you are after, then
/// use the SweepTwoRail class with options to generate the swept geometry
///
/// Rail to sweep shapes along
/// Rail to sweep shapes along
/// Shape curves
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweep(Curve rail1, Curve rail2, IEnumerable shapes, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail1, rail2, shapes, closed, tolerance);
}
///
/// Sweep1 function tht fits a surface through a profile curve that define the surface cross-sections
/// and one curve that defines a surface edge. The Segmented version breaks the rail at curvature kinks
/// and sweeps each piece separately, then put the results together into a Brep.
///
/// Rail to sweep shapes along
/// Shape curve
/// Only matters if shape is closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
///
/// If you are not producing the sweep results that you are after, then
/// use the SweepOneRail class with options to generate the swept geometry.
///
public static Brep[] CreateFromSweepSegmented(Curve rail, Curve shape, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail, shape, closed, tolerance);
}
///
/// Sweep1 function tht fits a surface through a series of profile curves that define the surface cross-sections
/// and one curve that defines a surface edge. The Segmented version breaks the rail at curvature kinks
/// and sweeps each piece separately, then put the results together into a Brep.
///
/// Rail to sweep shapes along
/// Shape curves
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
///
/// If you are not producing the sweep results that you are after, then
/// use the SweepOneRail class with options to generate the swept geometry.
///
public static Brep[] CreateFromSweepSegmented(Curve rail, IEnumerable shapes, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail, shapes, closed, tolerance);
}
///
/// Makes a 2 rail sweep. Like CreateFromSweep but the result is split where parameterization along a rail changes abruptly
///
/// Rail to sweep shapes along
/// Rail to sweep shapes along
/// Shape curves
/// Shape parameters
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweepInParts(Curve rail1, Curve rail2, IEnumerable shapes, IEnumerable rail_params, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail1, rail2, shapes, rail_params, closed, tolerance);
}
///
/// Extrude a curve to a taper making a brep (potentially more than 1)
///
/// the curve to extrude
/// the distance to extrude
/// the direction of the extrusion
/// the basepoint of the extrusion
/// angle of the extrusion
///
/// tolerance to use for the extrusion
/// angle tolerance to use for the extrusion
/// array of breps on success
public static Brep[] CreateFromTaperedExtrude(Curve curveToExtrude, double distance, Vector3d direction, Point3d basePoint, double draftAngleRadians, ExtrudeCornerType cornerType, double tolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), curveToExtrude, distance, direction, basePoint, draftAngleRadians, cornerType, tolerance, angleToleranceRadians);
}
///
/// Extrude a curve to a taper making a brep (potentially more than 1)
///
/// the curve to extrude
/// the distance to extrude
/// the direction of the extrusion
/// the basepoint of the extrusion
/// angle of the extrusion
///
/// array of breps on success
/// tolerances used are based on the active doc tolerance
public static Brep[] CreateFromTaperedExtrude(Curve curveToExtrude, double distance, Vector3d direction, Point3d basePoint, double draftAngleRadians, ExtrudeCornerType cornerType)
{
return ComputeServer.Post(ApiAddress(), curveToExtrude, distance, direction, basePoint, draftAngleRadians, cornerType);
}
///
/// Makes a surface blend between two surface edges.
///
/// First face to blend from.
/// First edge to blend from.
/// The domain of edge0 to use.
/// If false, edge0 will be used in its natural direction. If true, edge0 will be used in the reversed direction.
/// Continuity for the blend at the start.
/// Second face to blend from.
/// Second edge to blend from.
/// The domain of edge1 to use.
/// If false, edge1 will be used in its natural direction. If true, edge1 will be used in the reversed direction.
/// Continuity for the blend at the end.
/// Array of Breps if successful.
public static Brep[] CreateBlendSurface(BrepFace face0, BrepEdge edge0, Interval domain0, bool rev0, BlendContinuity continuity0, BrepFace face1, BrepEdge edge1, Interval domain1, bool rev1, BlendContinuity continuity1)
{
return ComputeServer.Post(ApiAddress(), face0, edge0, domain0, rev0, continuity0, face1, edge1, domain1, rev1, continuity1);
}
///
/// Makes a curve blend between points on two surface edges. The blend will be tangent to the surfaces and perpendicular to the edges.
///
/// First face to blend from.
/// First edge to blend from.
/// Location on first edge for first end of blend curve.
/// If false, edge0 will be used in its natural direction. If true, edge0 will be used in the reversed direction.
/// Continuity for the blend at the start.
/// Second face to blend from.
/// Second edge to blend from.
/// Location on second edge for second end of blend curve.
/// If false, edge1 will be used in its natural direction. If true, edge1 will be used in the reversed direction.
/// >Continuity for the blend at the end.
/// The blend curve on success. null on failure
public static Curve CreateBlendShape(BrepFace face0, BrepEdge edge0, double t0, bool rev0, BlendContinuity continuity0, BrepFace face1, BrepEdge edge1, double t1, bool rev1, BlendContinuity continuity1)
{
return ComputeServer.Post(ApiAddress(), face0, edge0, t0, rev0, continuity0, face1, edge1, t1, rev1, continuity1);
}
///
/// Creates a constant-radius round surface between two surfaces.
///
/// First face to fillet from.
/// A parameter face0 at the side you want to keep after filleting.
/// Second face to fillet from.
/// A parameter face1 at the side you want to keep after filleting.
/// The fillet radius.
/// If true, then when one input surface is longer than the other, the fillet surface is extended to the input surface edges.
/// The tolerance. In in doubt, the the document's model absolute tolerance.
/// Array of Breps if successful.
public static Brep[] CreateFilletSurface(BrepFace face0, Point2d uv0, BrepFace face1, Point2d uv1, double radius, bool extend, double tolerance)
{
return ComputeServer.Post(ApiAddress(), face0, uv0, face1, uv1, radius, extend, tolerance);
}
///
/// Creates a constant-radius round surface between two surfaces.
///
/// First face to fillet from.
/// A parameter face0 at the side you want to keep after filleting.
/// Second face to fillet from.
/// A parameter face1 at the side you want to keep after filleting.
/// The fillet radius.
/// If true, the input faces will be trimmed, if false, the input faces will be split.
/// If true, then when one input surface is longer than the other, the fillet surface is extended to the input surface edges.
/// The tolerance. In in doubt, the the document's model absolute tolerance.
/// The trim or split results of the Brep owned by face0.
/// The trim or split results of the Brep owned by face1.
/// Array of Breps if successful.
public static Brep[] CreateFilletSurface(BrepFace face0, Point2d uv0, BrepFace face1, Point2d uv1, double radius, bool trim, bool extend, double tolerance, out Brep[] outBreps0, out Brep[] outBreps1)
{
return ComputeServer.Post(ApiAddress(), out outBreps0, out outBreps1, face0, uv0, face1, uv1, radius, trim, extend, tolerance);
}
///
/// Creates a ruled surface as a bevel between two input surface edges.
///
/// First face to chamfer from.
/// A parameter face0 at the side you want to keep after chamfering.
/// The distance from the intersection of face0 to the edge of the chamfer.
/// Second face to chamfer from.
/// A parameter face1 at the side you want to keep after chamfering.
/// The distance from the intersection of face1 to the edge of the chamfer.
/// If true, then when one input surface is longer than the other, the chamfer surface is extended to the input surface edges.
/// The tolerance. In in doubt, the the document's model absolute tolerance.
/// Array of Breps if successful.
public static Brep[] CreateChamferSurface(BrepFace face0, Point2d uv0, double radius0, BrepFace face1, Point2d uv1, double radius1, bool extend, double tolerance)
{
return ComputeServer.Post(ApiAddress(), face0, uv0, radius0, face1, uv1, radius1, extend, tolerance);
}
///
/// Creates a ruled surface as a bevel between two input surface edges.
///
/// First face to chamfer from.
/// A parameter face0 at the side you want to keep after chamfering.
/// The distance from the intersection of face0 to the edge of the chamfer.
/// Second face to chamfer from.
/// A parameter face1 at the side you want to keep after chamfering.
/// The distance from the intersection of face1 to the edge of the chamfer.
/// If true, the input faces will be trimmed, if false, the input faces will be split.
/// If true, then when one input surface is longer than the other, the chamfer surface is extended to the input surface edges.
/// The tolerance. In in doubt, the the document's model absolute tolerance.
/// The trim or split results of the Brep owned by face0.
/// The trim or split results of the Brep owned by face1.
/// Array of Breps if successful.
public static Brep[] CreateChamferSurface(BrepFace face0, Point2d uv0, double radius0, BrepFace face1, Point2d uv1, double radius1, bool trim, bool extend, double tolerance, out Brep[] outBreps0, out Brep[] outBreps1)
{
return ComputeServer.Post(ApiAddress(), out outBreps0, out outBreps1, face0, uv0, radius0, face1, uv1, radius1, trim, extend, tolerance);
}
///
/// Fillets, chamfers, or blends the edges of a brep.
///
/// The brep to fillet, chamfer, or blend edges.
/// An array of one or more edge indices where the fillet, chamfer, or blend will occur.
/// An array of starting fillet, chamfer, or blend radaii, one for each edge index.
/// An array of ending fillet, chamfer, or blend radaii, one for each edge index.
/// The blend type.
/// The rail type.
/// The tolerance to be used to perform calculations.
/// Array of Breps if successful.
public static Brep[] CreateFilletEdges(Brep brep, IEnumerable edgeIndices, IEnumerable startRadii, IEnumerable endRadii, BlendType blendType, RailType railType, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, edgeIndices, startRadii, endRadii, blendType, railType, tolerance);
}
///
/// Offsets a Brep.
///
/// The Brep to offset.
///
/// The distance to offset. This is a signed distance value with respect to
/// face normals and flipped faces.
///
///
/// If true, then the function makes a closed solid from the input and offset
/// surfaces by lofting a ruled surface between all of the matching edges.
///
///
/// If true, then the function maintains the sharp corners when the original
/// surfaces have sharps corner. If False, then the function creates fillets
/// at sharp corners in the original surfaces.
///
/// The offset tolerance.
/// The results of the calculation.
/// The results of the calculation.
///
/// Array of Breps if successful. If the function succeeds in offsetting, a
/// single Brep will be returned. Otherwise, the array will contain the
/// offset surfaces, outBlends will contain the set of blends used to fill
/// in gaps (if extend is false), and outWalls will contain the set of wall
/// surfaces that was supposed to join the offset to the original (if solid
/// is true).
///
public static Brep[] CreateOffsetBrep(Brep brep, double distance, bool solid, bool extend, double tolerance, out Brep[] outBlends, out Brep[] outWalls)
{
return ComputeServer.Post(ApiAddress(), out outBlends, out outWalls, brep, distance, solid, extend, tolerance);
}
///
/// Joins two naked edges, or edges that are coincident or close together, from two Breps.
///
/// The first Brep.
/// The edge index on the first Brep.
/// The second Brep.
/// The edge index on the second Brep.
/// The join tolerance.
/// The resulting Brep if successful, null on failure.
public static Brep CreateFromJoinedEdges(Brep brep0, int edgeIndex0, Brep brep1, int edgeIndex1, double joinTolerance)
{
return ComputeServer.Post(ApiAddress(), brep0, edgeIndex0, brep1, edgeIndex1, joinTolerance);
}
///
/// Constructs one or more Breps by lofting through a set of curves.
///
///
/// The curves to loft through. This function will not perform any curve sorting. You must pass in
/// curves in the order you want them lofted. This function will not adjust the directions of open
/// curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves.
/// This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to
/// adjust the seam of closed curves.
///
///
/// Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
///
///
/// Optional ending point of loft. Use Point3d.Unset if you do not want to include an end point.
///
/// type of loft to perform.
/// true if the last curve in this loft should be connected back to the first one.
///
/// Constructs a closed surface, continuing the surface past the last curve around to the
/// first curve. Available when you have selected three shape curves.
///
///
/// ```
///
``````
///
``````
///
```

```
public static Brep[] CreateFromLoft(IEnumerable
``` curves, Point3d start, Point3d end, LoftType loftType, bool closed)
{
return ComputeServer.Post(ApiAddress(), curves, start, end, loftType, closed);
}
///
/// Constructs one or more Breps by lofting through a set of curves. Input for the loft is simplified by
/// rebuilding to a specified number of control points.
///
///
/// The curves to loft through. This function will not perform any curve sorting. You must pass in
/// curves in the order you want them lofted. This function will not adjust the directions of open
/// curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves.
/// This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to
/// adjust the seam of closed curves.
///
///
/// Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
///
///
/// Optional ending point of lost. Use Point3d.Unset if you do not want to include an end point.
///
/// type of loft to perform.
/// true if the last curve in this loft should be connected back to the first one.
/// A number of points to use while rebuilding the curves. 0 leaves turns this parameter off.
///
/// Constructs a closed surface, continuing the surface past the last curve around to the
/// first curve. Available when you have selected three shape curves.
///
public static Brep[] CreateFromLoftRebuild(IEnumerable curves, Point3d start, Point3d end, LoftType loftType, bool closed, int rebuildPointCount)
{
return ComputeServer.Post(ApiAddress(), curves, start, end, loftType, closed, rebuildPointCount);
}
///
/// Constructs one or more Breps by lofting through a set of curves. Input for the loft is simplified by
/// refitting to a specified tolerance.
///
///
/// The curves to loft through. This function will not perform any curve sorting. You must pass in
/// curves in the order you want them lofted. This function will not adjust the directions of open
/// curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves.
/// This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to
/// adjust the seam of closed curves.
///
///
/// Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
///
///
/// Optional ending point of lost. Use Point3d.Unset if you do not want to include an end point.
///
/// type of loft to perform.
/// true if the last curve in this loft should be connected back to the first one.
/// A distance to use in refitting, or 0 if you want to turn this parameter off.
///
/// Constructs a closed surface, continuing the surface past the last curve around to the
/// first curve. Available when you have selected three shape curves.
///
public static Brep[] CreateFromLoftRefit(IEnumerable curves, Point3d start, Point3d end, LoftType loftType, bool closed, double refitTolerance)
{
return ComputeServer.Post(ApiAddress(), curves, start, end, loftType, closed, refitTolerance);
}
///
/// Compute the Boolean Union of a set of Breps.
///
/// Breps to union.
/// Tolerance to use for union operation.
/// An array of Brep results or null on failure.
public static Brep[] CreateBooleanUnion(IEnumerable breps, double tolerance)
{
return ComputeServer.Post(ApiAddress(), breps, tolerance);
}
///
/// Compute the Boolean Union of a set of Breps.
///
/// Breps to union.
/// Tolerance to use for union operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
public static Brep[] CreateBooleanUnion(IEnumerable breps, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), breps, tolerance, manifoldOnly);
}
///
/// Compute the Solid Intersection of two sets of Breps.
///
/// First set of Breps.
/// Second set of Breps.
/// Tolerance to use for intersection operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(IEnumerable firstSet, IEnumerable secondSet, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance);
}
///
/// Compute the Solid Intersection of two sets of Breps.
///
/// First set of Breps.
/// Second set of Breps.
/// Tolerance to use for intersection operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(IEnumerable firstSet, IEnumerable secondSet, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance, manifoldOnly);
}
///
/// Compute the Solid Intersection of two Breps.
///
/// First Brep for boolean intersection.
/// Second Brep for boolean intersection.
/// Tolerance to use for intersection operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(Brep firstBrep, Brep secondBrep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance);
}
///
/// Compute the Solid Intersection of two Breps.
///
/// First Brep for boolean intersection.
/// Second Brep for boolean intersection.
/// Tolerance to use for intersection operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(Brep firstBrep, Brep secondBrep, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance, manifoldOnly);
}
///
/// Compute the Solid Difference of two sets of Breps.
///
/// First set of Breps (the set to subtract from).
/// Second set of Breps (the set to subtract).
/// Tolerance to use for difference operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
///
/// ```
///
``````
///
``````
///
```

```
public static Brep[] CreateBooleanDifference(IEnumerable
``` firstSet, IEnumerable secondSet, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance);
}
///
/// Compute the Solid Difference of two sets of Breps.
///
/// First set of Breps (the set to subtract from).
/// Second set of Breps (the set to subtract).
/// Tolerance to use for difference operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
///
/// ```
///
``````
///
``````
///
```

```
public static Brep[] CreateBooleanDifference(IEnumerable
``` firstSet, IEnumerable secondSet, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance, manifoldOnly);
}
///
/// Compute the Solid Difference of two Breps.
///
/// First Brep for boolean difference.
/// Second Brep for boolean difference.
/// Tolerance to use for difference operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanDifference(Brep firstBrep, Brep secondBrep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance);
}
///
/// Compute the Solid Difference of two Breps.
///
/// First Brep for boolean difference.
/// Second Brep for boolean difference.
/// Tolerance to use for difference operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanDifference(Brep firstBrep, Brep secondBrep, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance, manifoldOnly);
}
///
/// Creates a hollowed out shell from a solid Brep. Function only operates on simple, solid, manifold Breps.
///
/// The solid Brep to shell.
/// The indices of the Brep faces to remove. These surfaces are removed and the remainder is offset inward, using the outer parts of the removed surfaces to join the inner and outer parts.
/// The distance, or thickness, for the shell. This is a signed distance value with respect to face normals and flipped faces.
/// The offset tolerane. When in doubt, use the document's absolute tolerance.
/// An array of Brep results or null on failure.
public static Brep[] CreateShell(Brep brep, IEnumerable facesToRemove, double distance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, facesToRemove, distance, tolerance);
}
///
/// Joins the breps in the input array at any overlapping edges to form
/// as few as possible resulting breps. There may be more than one brep in the result array.
///
/// A list, an array or any enumerable set of breps to join.
/// 3d distance tolerance for detecting overlapping edges.
/// new joined breps on success, null on failure.
public static Brep[] JoinBreps(IEnumerable brepsToJoin, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepsToJoin, tolerance);
}
///
/// Combines two or more breps into one. A merge is like a boolean union that keeps the inside pieces. This
/// function creates non-manifold Breps which in general are unusual in Rhino. You may want to consider using
/// JoinBreps or CreateBooleanUnion functions instead.
///
/// must contain more than one Brep.
/// the tolerance to use when merging.
/// Single merged Brep on success. Null on error.
///
public static Brep MergeBreps(IEnumerable brepsToMerge, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepsToMerge, tolerance);
}
///
/// Constructs the contour curves for a brep at a specified interval.
///
/// A brep or polysurface.
/// A point to start.
/// A point to use as the end.
/// The interaxial offset in world units.
/// An array with intersected curves. This array can be empty.
///
/// ```
///
``````
///
``````
///
```

```
public static Curve[] CreateContourCurves(Brep brepToContour, Point3d contourStart, Point3d contourEnd, double interval)
{
return ComputeServer.Post
```(ApiAddress(), brepToContour, contourStart, contourEnd, interval);
}
///
/// Constructs the contour curves for a brep, using a slicing plane.
///
/// A brep or polysurface.
/// A plane.
/// An array with intersected curves. This array can be empty.
public static Curve[] CreateContourCurves(Brep brepToContour, Plane sectionPlane)
{
return ComputeServer.Post(ApiAddress(), brepToContour, sectionPlane);
}
///
/// Constructs all the Wireframe curves for this Brep.
///
/// Wireframe density. Valid values range between -1 and 99.
/// An array of Wireframe curves or null on failure.
public static Curve[] GetWireframe(this Brep brep, int density)
{
return ComputeServer.Post(ApiAddress(), brep, density);
}
///
/// Finds a point on the brep that is closest to testPoint.
///
/// Base point to project to brep.
/// The point on the Brep closest to testPoint or Point3d.Unset if the operation failed.
public static Point3d ClosestPoint(this Brep brep, Point3d testPoint)
{
return ComputeServer.Post(ApiAddress(), brep, testPoint);
}
///
/// Determines if point 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 point with brep, finds the intersection point Q closest
/// to point, 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.
///
/// 3d point to test.
///
/// 3d distance tolerance used for intersection and determining strict inclusion.
/// A good default is RhinoMath.SqrtEpsilon.
///
///
/// if true, point is in if inside brep by at least tolerance.
/// if false, point is in if truly in or within tolerance of boundary.
///
///
/// true if point is in, false if not.
///
public static bool IsPointInside(this Brep brep, Point3d point, double tolerance, bool strictlyIn)
{
return ComputeServer.Post(ApiAddress(), brep, point, tolerance, strictlyIn);
}
///
/// Returns a new Brep that is equivalent to this Brep with all planar holes capped.
///
/// Tolerance to use for capping.
/// New brep on success. null on error.
public static Brep CapPlanarHoles(this Brep brep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, tolerance);
}
///
/// If any edges of this brep overlap edges of otherBrep, merge a copy of otherBrep into this
/// brep joining all edges that overlap within tolerance.
///
/// Brep to be added to this brep.
/// 3d distance tolerance for detecting overlapping edges.
/// if true, set brep flags and tolerances, remove unused faces and edges.
/// true if any edges were joined.
///
/// if no edges overlap, this brep is unchanged.
/// otherBrep is copied if it is merged with this, and otherBrep is always unchanged
/// Use this to join a list of breps in a series.
/// When joining multiple breps in series, compact should be set to false.
/// Call compact on the last Join.
///
public static bool Join(this Brep brep, out Brep updatedInstance, Brep otherBrep, double tolerance, bool compact)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, otherBrep, tolerance, compact);
}
///
/// Joins naked edge pairs within the same brep that overlap within tolerance.
///
/// The tolerance value.
/// number of joins made.
public static int JoinNakedEdges(this Brep brep, out Brep updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance);
}
///
/// Merges adjacent coplanar faces into single faces.
///
///
/// Tolerance for determining when edges are adjacent.
/// When in doubt, use the document's ModelAbsoluteTolerance property.
///
/// true if faces were merged, false if no faces were merged.
public static bool MergeCoplanarFaces(this Brep brep, out Brep updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance);
}
///
/// Merges adjacent coplanar faces into single faces.
///
///
/// Tolerance for determining when edges are adjacent.
/// When in doubt, use the document's ModelAbsoluteTolerance property.
///
///
/// Angle tolerance, in radians, for determining when faces are parallel.
/// When in doubt, use the document's ModelAngleToleranceRadians property.
///
/// true if faces were merged, false if no faces were merged.
public static bool MergeCoplanarFaces(this Brep brep, out Brep updatedInstance, double tolerance, double angleTolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance, angleTolerance);
}
///
/// Splits a Brep into pieces using a Brep as a cutter.
///
/// The Brep to use as a cutter.
/// The tolerance with which to compute intersections.
/// A new array of Breps. This array can be empty.
public static Brep[] Split(this Brep brep, Brep cutter, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutter, intersectionTolerance);
}
///
/// Splits a Brep into pieces using a Brep as a cutter.
///
/// The Brep to use as a cutter.
/// The tolerance with which to compute intersections.
///
/// Set to true if the split failed at intersectionTolerance but succeeded
/// when the tolerance was increased to twice intersectionTolerance.
///
/// A new array of Breps. This array can be empty.
public static Brep[] Split(this Brep brep, Brep cutter, double intersectionTolerance, out bool toleranceWasRaised)
{
return ComputeServer.Post(ApiAddress(), out toleranceWasRaised, brep, cutter, intersectionTolerance);
}
///
/// Splits a Brep into pieces using Breps as cutters.
///
/// One or more Breps to use as cutters.
/// The tolerance with which to compute intersections.
/// A new array of Breps. This array can be empty.
public static Brep[] Split(this Brep brep, IEnumerable cutters, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutters, intersectionTolerance);
}
///
/// Splits a Brep into pieces using curves, at least partially on the Brep, as cutters.
///
/// The splitting curves. Only the portion of the curve on the Brep surface will be used for cutting.
/// The tolerance with which to compute intersections.
/// A new array of Breps. This array can be empty.
public static Brep[] Split(this Brep brep, IEnumerable cutters, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutters, intersectionTolerance);
}
///
/// Splits a Brep into pieces using a combination of curves, to be extruded, and Breps as cutters.
///
/// The curves, surfaces, faces and Breps to be used as cutters. Any other geometry is ignored.
/// A construction plane normal, used in deciding how to extrude a curve into a cutter.
/// Set true if the assume view is a plan, or parallel projection, view.
/// The tolerance with which to compute intersections.
/// A new array of Breps. This array can be empty.
///
/// A Curve in cutters is extruded to produce a surface to use as a cutter. The extrusion direction is choosen, as in the Rhino Split command,
/// based on the properties of the active view. In particular the construction plane Normal and whether the active view is a plan view,
/// a parallel projection with construction plane normal as the view direction. If planView is false and the curve is planar then the curve
/// is extruded perpendicular to the curve, otherwise the curve is extruded in the normal direction.
///
public static Brep[] Split(this Brep brep, IEnumerable cutters, Vector3d normal, bool planView, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutters, normal, planView, intersectionTolerance);
}
///
/// Trims a brep with an oriented cutter. The parts of the brep that lie inside
/// (opposite the normal) of the cutter are retained while the parts to the
/// outside (in the direction of the normal) are discarded. If the Cutter is
/// closed, then a connected component of the Brep that does not intersect the
/// cutter is kept if and only if it is contained in the inside of cutter.
/// That is the region bounded by cutter opposite from the normal of cutter,
/// If cutter is not closed all these components are kept.
///
/// A cutting brep.
/// A tolerance value with which to compute intersections.
/// This Brep is not modified, the trim results are returned in an array.
public static Brep[] Trim(this Brep brep, Brep cutter, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutter, intersectionTolerance);
}
///
/// Trims a Brep with an oriented cutter. The parts of Brep that lie inside
/// (opposite the normal) of the cutter are retained while the parts to the
/// outside ( in the direction of the normal ) are discarded. A connected
/// component of Brep that does not intersect the cutter is kept if and only
/// if it is contained in the inside of Cutter. That is the region bounded by
/// cutter opposite from the normal of cutter, or in the case of a Plane cutter
/// the halfspace opposite from the plane normal.
///
/// A cutting plane.
/// A tolerance value with which to compute intersections.
/// This Brep is not modified, the trim results are returned in an array.
public static Brep[] Trim(this Brep brep, Plane cutter, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutter, intersectionTolerance);
}
///
/// Unjoins, or separates, edges within the Brep. Note, seams in closed surfaces will not separate.
///
/// The indices of the Brep edges to unjoin.
/// This Brep is not modified, the trim results are returned in an array.
public static Brep[] UnjoinEdges(this Brep brep, IEnumerable edgesToUnjoin)
{
return ComputeServer.Post(ApiAddress(), brep, edgesToUnjoin);
}
///
/// Joins two naked edges, or edges that are coincident or close together.
///
/// The first edge index.
/// The second edge index.
/// The join tolerance.
///
/// If joining more than one edge pair and want the edge indices of subsequent pairs to remain valid,
/// set to false. But then call Brep.Compact() on the final result.
///
/// true if successful, false otherwise.
public static bool JoinEdges(this Brep brep, out Brep updatedInstance, int edgeIndex0, int edgeIndex1, double joinTolerance, bool compact)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, edgeIndex0, edgeIndex1, joinTolerance, compact);
}
///
/// Transform an array of Brep components, bend neighbors to match, and leave the rest fixed.
///
/// The Brep components to transform.
/// The transformation to apply.
/// The desired fitting tolerance to use when bending faces that share edges with both fixed and transformed components.
///
/// If the deformation is extreme, it can take a long time to calculate the result.
/// If time_limit > 0, then the value specifies the maximum amount of time in seconds you want to spend before giving up.
///
/// True if multiple threads can be used.
/// true if successful, false otherwise.
public static bool TransformComponent(this Brep brep, out Brep updatedInstance, IEnumerable components, Transform xform, double tolerance, double timeLimit, bool useMultipleThreads)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, components, xform, tolerance, timeLimit, useMultipleThreads);
}
///
/// Compute the Area of the Brep. If you want proper Area data with moments
/// and error information, use the AreaMassProperties class.
///
/// The area of the Brep.
public static double GetArea(this Brep brep)
{
return ComputeServer.Post(ApiAddress(), brep);
}
///
/// Compute the Area of the Brep. If you want proper Area data with moments
/// and error information, use the AreaMassProperties class.
///
/// Relative tolerance to use for area calculation.
/// Absolute tolerance to use for area calculation.
/// The area of the Brep.
public static double GetArea(this Brep brep, double relativeTolerance, double absoluteTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, relativeTolerance, absoluteTolerance);
}
///
/// Compute the Volume of the Brep. If you want proper Volume data with moments
/// and error information, use the VolumeMassProperties class.
///
/// The volume of the Brep.
public static double GetVolume(this Brep brep)
{
return ComputeServer.Post(ApiAddress(), brep);
}
///
/// Compute the Volume of the Brep. If you want proper Volume data with moments
/// and error information, use the VolumeMassProperties class.
///
/// Relative tolerance to use for area calculation.
/// Absolute tolerance to use for area calculation.
/// The volume of the Brep.
public static double GetVolume(this Brep brep, double relativeTolerance, double absoluteTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, relativeTolerance, absoluteTolerance);
}
///
/// 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 surface of the face to a NurbsSurface.
///
///
/// Face whose underlying surface has a parameterization that is different
/// from its NURBS form.
///
/// NURBS form of the face's underlying surface.
///
/// Don't call this function unless you know exactly what you are doing.
///
public static Brep RebuildTrimsForV2(this Brep brep, BrepFace face, NurbsSurface nurbsSurface)
{
return ComputeServer.Post(ApiAddress(), brep, face, nurbsSurface);
}
///
/// No support is available for this function.
/// Expert user function that converts all geometry in brep to nurbs form.
///
///
/// Don't call this function unless you know exactly what you are doing.
///
public static bool MakeValidForV2(this Brep brep, out Brep updatedInstance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep);
}
///
/// Fills in missing or fixes incorrect component information from a Brep.
/// Useful when reading Brep information from other file formats that do not
/// provide as complete of a Brep definition as requried by Rhino.
///
/// The repair tolerance. When in doubt, use the document's model absolute tolerance.
/// True on success.
public static bool Repair(this Brep brep, out Brep updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance);
}
///
/// Remove all inner loops, or holes, in a Brep.
///
/// The tolerance. When in doubt, use the document's model absolute tolerance.
/// The Brep without holes if successful, null otherwise.
public static Brep RemoveHoles(this Brep brep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, tolerance);
}
///
/// Removes inner loops, or holes, in a Brep.
///
/// A list of BrepLoop component indexes, where BrepLoop.LoopType == Rhino.Geometry.BrepLoopType.Inner.
/// The tolerance. When in doubt, use the document's model absolute tolerance.
/// The Brep without holes if successful, null otherwise.
public static Brep RemoveHoles(this Brep brep, IEnumerable loops, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, loops, tolerance);
}
}
public static class BrepFaceCompute
{
static string ApiAddress([CallerMemberName] string caller = null)
{
return ComputeServer.ApiAddress(typeof(BrepFace), caller);
}
///
/// Pulls one or more points to a brep face.
///
/// Points to pull.
/// Tolerance for pulling operation. Only points that are closer than tolerance will be pulled to the face.
/// An array of pulled points.
public static Point3d[] PullPointsToFace(this BrepFace brepface, IEnumerable points, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepface, points, tolerance);
}
///
/// Returns the surface draft angle and point at a parameter.
///
/// The u,v parameter on the face to evaluate.
/// The angle in radians to test.
/// The pull direction.
/// Restricts the point placement to an edge.
/// The draft angle point.
/// The draft angle in radians.
/// True if successful, false otherwise.
public static bool DraftAnglePoint(this BrepFace brepface, Point2d testPoint, double testAngle, Vector3d pullDirection, bool edge, out Point3d draftPoint, out double draftAngle)
{
return ComputeServer.Post(ApiAddress(), out draftPoint, out draftAngle, brepface, testPoint, testAngle, pullDirection, edge);
}
///
/// Remove all inner loops, or holes, from a Brep face.
///
///
///
public static Brep RemoveHoles(this BrepFace brepface, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepface, tolerance);
}
///
/// Split this face using 3D trimming curves.
///
/// Curves to split with.
/// Tolerance for splitting, when in doubt use the Document Absolute Tolerance.
/// A brep consisting of all the split fragments, or null on failure.
///
/// ```
///
``````
///
``````
///
```

```
public static Brep Split(this BrepFace brepface, IEnumerable
``` curves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepface, curves, tolerance);
}
///
/// Tests if a parameter space point is on the interior of a trimmed face.
///
/// Parameter space point u value.
/// Parameter space point v value.
/// A value describing the spatial relationship between the point and the face.
public static PointFaceRelation IsPointOnFace(this BrepFace brepface, double u, double v)
{
return ComputeServer.Post(ApiAddress(), brepface, u, v);
}
///
/// Gets intervals where the iso curve exists on a BrepFace (trimmed surface)
///
/// Direction of isocurve.
/// 0 = Isocurve connects all points with a constant U value.
/// 1 = Isocurve connects all points with a constant V value.
///
/// Surface parameter that remains identical along the isocurves.
///
/// If direction = 0, the parameter space iso interval connects the 2d points
/// (intervals[i][0],iso_constant) and (intervals[i][1],iso_constant).
/// If direction = 1, the parameter space iso interval connects the 2d points
/// (iso_constant,intervals[i][0]) and (iso_constant,intervals[i][1]).
///
public static Interval[] TrimAwareIsoIntervals(this BrepFace brepface, int direction, double constantParameter)
{
return ComputeServer.Post(ApiAddress(), brepface, direction, constantParameter);
}
///
/// Similar to IsoCurve function, except this function pays attention to trims on faces
/// and may return multiple curves.
///
/// Direction of isocurve.
/// 0 = Isocurve connects all points with a constant U value.
/// 1 = Isocurve connects all points with a constant V value.
///
/// Surface parameter that remains identical along the isocurves.
/// Isoparametric curves connecting all points with the constantParameter value.
///
/// 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.
///
public static Curve[] TrimAwareIsoCurve(this BrepFace brepface, int direction, double constantParameter)
{
return ComputeServer.Post(ApiAddress(), brepface, direction, constantParameter);
}
///
/// Expert user tool that replaces the 3d surface geometry use by the face.
///
/// brep surface index of new surface.
/// true if successful.
///
/// If the face had a surface and new surface has a different shape, then
/// you probably want to call something like RebuildEdges() to move
/// the 3d edge curves so they will lie on the new surface. This doesn't
/// delete the old surface; call Brep.CullUnusedSurfaces() or Brep.Compact()
/// to remove unused surfaces.
///
public static bool ChangeSurface(this BrepFace brepface, out BrepFace updatedInstance, int surfaceIndex)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brepface, surfaceIndex);
}
///
/// Rebuild the edges used by a face so they lie on the surface.
///
/// tolerance for fitting 3d edge curves.
///
/// if false and and edge is used by this face and a neighbor, then the edge
/// will be skipped.
///
///
/// if true, vertex locations are updated to lie on the surface.
///
/// true on success.
public static bool RebuildEdges(this BrepFace brepface, out BrepFace updatedInstance, double tolerance, bool rebuildSharedEdges, bool rebuildVertices)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brepface, tolerance, rebuildSharedEdges, rebuildVertices);
}
}
public static class CurveCompute
{
static string ApiAddress([CallerMemberName] string caller = null)
{
return ComputeServer.ApiAddress(typeof(Curve), caller);
}
///
/// Returns the type of conic section based on the curve's shape.
///
///
public static ConicSectionType GetConicSectionType(this Curve curve)
{
return ComputeServer.Post(ApiAddress(), curve);
}
///
/// Interpolates a sequence of points. Used by InterpCurve Command
/// This routine works best when degree=3.
///
/// The degree of the curve >=1. Degree must be odd.
///
/// Points to interpolate (Count must be >= 2)
///
/// interpolated curve on success. null on failure.
public static Curve CreateInterpolatedCurve(IEnumerable points, int degree)
{
return ComputeServer.Post(ApiAddress(), points, degree);
}
///
/// Interpolates a sequence of points. Used by InterpCurve Command
/// This routine works best when degree=3.
///
/// The degree of the curve >=1. Degree must be odd.
///
/// Points to interpolate. For periodic curves if the final point is a
/// duplicate of the initial point it is ignored. (Count must be >=2)
///
///
/// Knot-style to use and specifies if the curve should be periodic.
///
/// interpolated curve on success. null on failure.
public static Curve CreateInterpolatedCurve(IEnumerable points, int degree, CurveKnotStyle knots)
{
return ComputeServer.Post(ApiAddress(), points, degree, knots);
}
///
/// Interpolates a sequence of points. Used by InterpCurve Command
/// This routine works best when degree=3.
///
/// The degree of the curve >=1. Degree must be odd.
///
/// Points to interpolate. For periodic curves if the final point is a
/// duplicate of the initial point it is ignored. (Count must be >=2)
///
///
/// Knot-style to use and specifies if the curve should be periodic.
///
/// A starting tangent.
/// An ending tangent.
/// interpolated curve on success. null on failure.
public static Curve CreateInterpolatedCurve(IEnumerable points, int degree, CurveKnotStyle knots, Vector3d startTangent, Vector3d endTangent)
{
return ComputeServer.Post(ApiAddress(), points, degree, knots, startTangent, endTangent);
}
///
/// Creates a soft edited curve from an exising curve using a smooth field of influence.
///
/// The curve to soft edit.
///
/// A parameter on the curve to move from. This location on the curve is moved, and the move
/// is smoothly tapered off with increasing distance along the curve from this parameter.
///
/// The direction and magitude, or maximum distance, of the move.
///
/// The distance along the curve from the editing point over which the strength
/// of the editing falls off smoothly.
///
///
/// The soft edited curve if successful. null on failure.
public static Curve CreateSoftEditCurve(Curve curve, double t, Vector3d delta, double length, bool fixEnds)
{
return ComputeServer.Post(ApiAddress(), curve, t, delta, length, fixEnds);
}
///
/// Rounds the corners of a kinked curve with arcs of a single, specified radius.
///
/// The curve to fillet.
/// The fillet radius.
/// The tolerance. When in doubt, use the document's model space absolute tolerance.
/// The angle tolerance in radians. When in doubt, use the document's model space angle tolerance.
/// The filleted curve if successful. null on failure.
public static Curve CreateFilletCornersCurve(Curve curve, double radius, double tolerance, double angleTolerance)
{
return ComputeServer.Post(ApiAddress(), curve, radius, tolerance, angleTolerance);
}
///
/// Creates a polycurve consisting of two tangent arc segments that connect two points and two directions.
///
/// Start of the arc blend curve.
/// Start direction of the arc blend curve.
/// End of the arc blend curve.
/// End direction of the arc blend curve.
///
/// The ratio of the control polygon lengths of the two arcs. Note, a value of 1.0
/// means the control polygon lengths for both arcs will be the same.
///
/// The arc blend curve, or null on error.
public static Curve CreateArcBlend(Point3d startPt, Vector3d startDir, Point3d endPt, Vector3d endDir, double controlPointLengthRatio)
{
return ComputeServer.Post(ApiAddress(), startPt, startDir, endPt, endDir, controlPointLengthRatio);
}
///
/// Constructs a mean, or average, curve from two curves.
///
/// A first curve.
/// A second curve.
///
/// The angle tolerance, in radians, used to match kinks between curves.
/// If you are unsure how to set this parameter, then either use the
/// document's angle tolerance RhinoDoc.AngleToleranceRadians,
/// or the default value (RhinoMath.UnsetValue)
///
/// The average curve, or null on error.
/// If curveA or curveB are null.
public static Curve CreateMeanCurve(Curve curveA, Curve curveB, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, angleToleranceRadians);
}
///
/// Constructs a mean, or average, curve from two curves.
///
/// A first curve.
/// A second curve.
/// The average curve, or null on error.
/// If curveA or curveB are null.
public static Curve CreateMeanCurve(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Create a Blend curve between two existing curves.
///
/// Curve to blend from (blending will occur at curve end point).
/// Curve to blend to (blending will occur at curve start point).
/// Continuity of blend.
/// A curve representing the blend between A and B or null on failure.
public static Curve CreateBlendCurve(Curve curveA, Curve curveB, BlendContinuity continuity)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, continuity);
}
///
/// Create a Blend curve between two existing curves.
///
/// Curve to blend from (blending will occur at curve end point).
/// Curve to blend to (blending will occur at curve start point).
/// Continuity of blend.
/// Bulge factor at curveA end of blend. Values near 1.0 work best.
/// Bulge factor at curveB end of blend. Values near 1.0 work best.
/// A curve representing the blend between A and B or null on failure.
public static Curve CreateBlendCurve(Curve curveA, Curve curveB, BlendContinuity continuity, double bulgeA, double bulgeB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, continuity, bulgeA, bulgeB);
}
///
/// Makes a curve blend between 2 curves at the parameters specified
/// with the directions and continuities specified
///
/// First curve to blend from
/// Parameter on first curve for blend endpoint
///
/// If false, the blend will go in the natural direction of the curve.
/// If true, the blend will go in the opposite direction to the curve
///
/// Continuity for the blend at the start
/// Second curve to blend from
/// Parameter on second curve for blend endpoint
///
/// If false, the blend will go in the natural direction of the curve.
/// If true, the blend will go in the opposite direction to the curve
///
/// Continuity for the blend at the end
/// The blend curve on success. null on failure
public static Curve CreateBlendCurve(Curve curve0, double t0, bool reverse0, BlendContinuity continuity0, Curve curve1, double t1, bool reverse1, BlendContinuity continuity1)
{
return ComputeServer.Post(ApiAddress(), curve0, t0, reverse0, continuity0, curve1, t1, reverse1, continuity1);
}
///
/// Creates curves between two open or closed input curves. Uses the control points of the curves for finding tween curves.
/// That means the first control point of first curve is matched to first control point of the second curve and so on.
/// There is no matching of curves direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurves(Curve curve0, Curve curve1, int numCurves)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves);
}
///
/// Creates curves between two open or closed input curves. Uses the control points of the curves for finding tween curves.
/// That means the first control point of first curve is matched to first control point of the second curve and so on.
/// There is no matching of curves direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
///
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurves(Curve curve0, Curve curve1, int numCurves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, tolerance);
}
///
/// Creates curves between two open or closed input curves. Make the structure of input curves compatible if needed.
/// Refits the input curves to have the same structure. The resulting curves are usually more complex than input unless
/// input curves are compatible and no refit is needed. There is no matching of curves direction.
/// Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithMatching(Curve curve0, Curve curve1, int numCurves)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves);
}
///
/// Creates curves between two open or closed input curves. Make the structure of input curves compatible if needed.
/// Refits the input curves to have the same structure. The resulting curves are usually more complex than input unless
/// input curves are compatible and no refit is needed. There is no matching of curves direction.
/// Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
///
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithMatching(Curve curve0, Curve curve1, int numCurves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, tolerance);
}
///
/// Creates curves between two open or closed input curves. Use sample points method to make curves compatible.
/// This is how the algorithm workd: Divides the two curves into an equal number of points, finds the midpoint between the
/// corresponding points on the curves and interpolates the tween curve through those points. There is no matching of curves
/// direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// Number of sample points along input curves.
/// >An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithSampling(Curve curve0, Curve curve1, int numCurves, int numSamples)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, numSamples);
}
///
/// Creates curves between two open or closed input curves. Use sample points method to make curves compatible.
/// This is how the algorithm workd: Divides the two curves into an equal number of points, finds the midpoint between the
/// corresponding points on the curves and interpolates the tween curve through those points. There is no matching of curves
/// direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// Number of sample points along input curves.
///
/// >An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithSampling(Curve curve0, Curve curve1, int numCurves, int numSamples, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, numSamples, tolerance);
}
///
/// Joins a collection of curve segments together.
///
/// Curve segments to join.
/// An array of curves which contains.
public static Curve[] JoinCurves(IEnumerable inputCurves)
{
return ComputeServer.Post(ApiAddress(), inputCurves);
}
///
/// Joins a collection of curve segments together.
///
/// An array, a list or any enumerable set of curve segments to join.
/// Joining tolerance,
/// i.e. the distance between segment end-points that is allowed.
/// An array of joint curves. This array can be empty.
///
/// ```
///
``````
///
``````
///
```

```
///
```If inputCurves is null.
public static Curve[] JoinCurves(IEnumerable inputCurves, double joinTolerance)
{
return ComputeServer.Post(ApiAddress(), inputCurves, joinTolerance);
}
///
/// Joins a collection of curve segments together.
///
/// An array, a list or any enumerable set of curve segments to join.
/// Joining tolerance,
/// i.e. the distance between segment end-points that is allowed.
///
/// If true, curve endpoints will be compared to curve startpoints.
/// If false, all start and endpoints will be compared and copies of input curves may be reversed in output.
///
/// An array of joint curves. This array can be empty.
/// If inputCurves is null.
public static Curve[] JoinCurves(IEnumerable inputCurves, double joinTolerance, bool preserveDirection)
{
return ComputeServer.Post(ApiAddress(), inputCurves, joinTolerance, preserveDirection);
}
///
/// Makes adjustments to the ends of one or both input curves so that they meet at a point.
///
/// 1st curve to adjust.
///
/// Which end of the 1st curve to adjust: true is start, false is end.
///
/// 2nd curve to adjust.
///
/// which end of the 2nd curve to adjust true==start, false==end.
///
/// true on success.
public static bool MakeEndsMeet(Curve curveA, bool adjustStartCurveA, Curve curveB, bool adjustStartCurveB)
{
return ComputeServer.Post(ApiAddress(), curveA, adjustStartCurveA, curveB, adjustStartCurveB);
}
///
/// Computes the fillet arc for a curve filleting operation.
///
/// First curve to fillet.
/// Second curve to fillet.
/// Fillet radius.
/// Parameter on curve0 where the fillet ought to start (approximately).
/// Parameter on curve1 where the fillet ought to end (approximately).
/// The fillet arc on success, or Arc.Unset on failure.
public static Arc CreateFillet(Curve curve0, Curve curve1, double radius, double t0Base, double t1Base)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, radius, t0Base, t1Base);
}
///
/// Creates a tangent arc between two curves and trims or extends the curves to the arc.
///
/// The first curve to fillet.
///
/// A point on the first curve that is near the end where the fillet will
/// be created.
///
/// The second curve to fillet.
///
/// A point on the second curve that is near the end where the fillet will
/// be created.
///
/// The radius of the fillet.
/// Join the output curves.
///
/// Trim copies of the input curves to the output fillet curve.
///
///
/// Applies when arcs are filleted but need to be extended to meet the
/// fillet curve or chamfer line. If true, then the arc is extended
/// maintaining its validity. If false, then the arc is extended with a
/// line segment, which is joined to the arc converting it to a polycurve.
///
///
/// The tolerance, generally the document's absolute tolerance.
///
///
///
/// The results of the fillet operation. The number of output curves depends
/// on the input curves and the values of the parameters that were used
/// during the fillet operation. In most cases, the output array will contain
/// either one or three curves, although two curves can be returned if the
/// radius is zero and join = false.
/// For example, if both join and trim = true, then the output curve
/// will be a polycurve containing the fillet curve joined with trimmed copies
/// of the input curves. If join = false and trim = true, then three curves,
/// the fillet curve and trimmed copies of the input curves, will be returned.
/// If both join and trim = false, then just the fillet curve is returned.
///
///
/// ```
///
``````
///
``````
///
```

```
public static Curve[] CreateFilletCurves(Curve curve0, Point3d point0, Curve curve1, Point3d point1, double radius, bool join, bool trim, bool arcExtension, double tolerance, double angleTolerance)
{
return ComputeServer.Post
```(ApiAddress(), curve0, point0, curve1, point1, radius, join, trim, arcExtension, tolerance, angleTolerance);
}
///
/// Calculates the boolean union of two or more closed, planar curves.
/// Note, curves must be co-planar.
///
/// The co-planar curves to union.
/// Result curves on success, empty array if no union could be calculated.
public static Curve[] CreateBooleanUnion(IEnumerable curves)
{
return ComputeServer.Post(ApiAddress(), curves);
}
///
/// Calculates the boolean union of two or more closed, planar curves.
/// Note, curves must be co-planar.
///
/// The co-planar curves to union.
///
/// Result curves on success, empty array if no union could be calculated.
public static Curve[] CreateBooleanUnion(IEnumerable curves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curves, tolerance);
}
///
/// Calculates the boolean intersection of two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
/// Result curves on success, empty array if no intersection could be calculated.
public static Curve[] CreateBooleanIntersection(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Calculates the boolean intersection of two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
///
/// Result curves on success, empty array if no intersection could be calculated.
public static Curve[] CreateBooleanIntersection(Curve curveA, Curve curveB, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, tolerance);
}
///
/// Calculates the boolean difference between two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Calculates the boolean difference between two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
///
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, Curve curveB, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, tolerance);
}
///
/// Calculates the boolean difference between a closed planar curve, and a list of closed planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// curves to subtract from the first closed curve.
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, IEnumerable subtractors)
{
return ComputeServer.Post(ApiAddress(), curveA, subtractors);
}
///
/// Calculates the boolean difference between a closed planar curve, and a list of closed planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// curves to subtract from the first closed curve.
///
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, IEnumerable subtractors, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, subtractors, tolerance);
}
///
/// Creates outline curves created from a text string. The functionality is similar to what you find in Rhino's TextObject command or TextEntity.Explode() in RhinoCommon.
///
/// The text from which to create outline curves.
/// The text font.
/// The text height.
/// The font style. The font style can be any number of the following: 0 - Normal, 1 - Bold, 2 - Italic
/// Set this value to True when dealing with normal fonts and when you expect closed loops. You may want to set this to False when specifying a single-stroke font where you don't want closed loops.
/// The plane on which the outline curves will lie.
/// Displays lower-case letters as small caps. Set the relative text size to a percentage of the normal text.
/// The tolerance for the operation.
/// An array containing one or more curves if successful.
public static Curve[] CreateTextOutlines(string text, string font, double textHeight, int textStyle, bool closeLoops, Plane plane, double smallCapsScale, double tolerance)
{
return ComputeServer.Post(ApiAddress(), text, font, textHeight, textStyle, closeLoops, plane, smallCapsScale, tolerance);
}
///
/// Creates a third curve from two curves that are planar in different construction planes.
/// The new curve looks the same as each of the original curves when viewed in each plane.
///
/// The first curve.
/// The second curve.
/// A vector defining the normal direction of the plane which the first curve is drawn upon.
/// A vector defining the normal direction of the plane which the seconf curve is drawn upon.
/// The tolerance for the operation.
/// The angle tolerance for the operation.
/// An array containing one or more curves if successful.
public static Curve[] CreateCurve2View(Curve curveA, Curve curveB, Vector3d vectorA, Vector3d vectorB, double tolerance, double angleTolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, vectorA, vectorB, tolerance, angleTolerance);
}
///
/// Determines whether two curves travel more or less in the same direction.
///
/// First curve to test.
/// Second curve to test.
/// true if both curves more or less point in the same direction,
/// false if they point in the opposite directions.
public static bool DoDirectionsMatch(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Projects a curve to a mesh using a direction and tolerance.
///
/// A curve.
/// A mesh.
/// A direction vector.
/// A tolerance value.
/// A curve array.
public static Curve[] ProjectToMesh(Curve curve, Mesh mesh, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, mesh, direction, tolerance);
}
///
/// Projects a curve to a set of meshes using a direction and tolerance.
///
/// A curve.
/// A list, an array or any enumerable of meshes.
/// A direction vector.
/// A tolerance value.
/// A curve array.
public static Curve[] ProjectToMesh(Curve curve, IEnumerable meshes, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, meshes, direction, tolerance);
}
///
/// Projects a curve to a set of meshes using a direction and tolerance.
///
/// A list, an array or any enumerable of curves.
/// A list, an array or any enumerable of meshes.
/// A direction vector.
/// A tolerance value.
/// A curve array.
public static Curve[] ProjectToMesh(IEnumerable curves, IEnumerable meshes, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curves, meshes, direction, tolerance);
}
///
/// Projects a Curve onto a Brep along a given direction.
///
/// Curve to project.
/// Brep to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// An array of projected curves or empty array if the projection set is empty.
public static Curve[] ProjectToBrep(Curve curve, Brep brep, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, brep, direction, tolerance);
}
///
/// Projects a Curve onto a collection of Breps along a given direction.
///
/// Curve to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// An array of projected curves or empty array if the projection set is empty.
public static Curve[] ProjectToBrep(Curve curve, IEnumerable breps, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, breps, direction, tolerance);
}
///
/// Projects a Curve onto a collection of Breps along a given direction.
///
/// Curve to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// (out) Integers that identify for each resulting curve which Brep it was projected onto.
/// An array of projected curves or null if the projection set is empty.
public static Curve[] ProjectToBrep(Curve curve, IEnumerable breps, Vector3d direction, double tolerance, out int[] brepIndices)
{
return ComputeServer.Post(ApiAddress(), out brepIndices, curve, breps, direction, tolerance);
}
///
/// Projects a collection of Curves onto a collection of Breps along a given direction.
///
/// Curves to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// An array of projected curves or empty array if the projection set is empty.
public static Curve[] ProjectToBrep(IEnumerable curves, IEnumerable breps, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curves, breps, direction, tolerance);
}
///
/// Projects a collection of Curves onto a collection of Breps along a given direction.
///
/// Curves to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// Index of which curve in the input list was the source for a curve in the return array.
/// Index of which brep was used to generate a curve in the return array.
/// An array of projected curves. Array is empty if the projection set is empty.
public static Curve[] ProjectToBrep(IEnumerable curves, IEnumerable breps, Vector3d direction, double tolerance, out int[] curveIndices, out int[] brepIndices)
{
return ComputeServer.Post(ApiAddress(), out curveIndices, out brepIndices, curves, breps, direction, tolerance);
}
///
/// Constructs a curve by projecting an existing curve to a plane.
///
/// A curve.
/// A plane.
/// The projected curve on success; null on failure.
public static Curve ProjectToPlane(Curve curve, Plane plane)
{
return ComputeServer.Post(ApiAddress(), curve, plane);
}
///
/// Pull a curve to a BrepFace using closest point projection.
///
/// Curve to pull.
/// Brepface that pulls.
/// Tolerance to use for pulling.
/// An array of pulled curves, or an empty array on failure.
public static Curve[] PullToBrepFace(Curve curve, BrepFace face, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, face, tolerance);
}
///
/// Determines whether two coplanar simple closed curves are disjoint or intersect;
/// otherwise, if the regions have a containment relationship, discovers
/// which curve encloses the other.
///
/// A first curve.
/// A second curve.
/// A plane.
/// A tolerance value.
///
/// A value indicating the relationship between the first and the second curve.
///
public static RegionContainment PlanarClosedCurveRelationship(Curve curveA, Curve curveB, Plane testPlane, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, testPlane, tolerance);
}
///
/// Determines if two coplanar curves collide (intersect).
///
/// A curve.
/// Another curve.
/// A valid plane containing the curves.
/// A tolerance value for intersection.
/// true if the curves intersect, otherwise false
public static bool PlanarCurveCollision(Curve curveA, Curve curveB, Plane testPlane, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, testPlane, tolerance);
}
///
/// Polylines will be exploded into line segments. ExplodeCurves will
/// return the curves in topological order.
///
///
/// An array of all the segments that make up this curve.
///
public static Curve[] DuplicateSegments(this Curve curve, out Curve updatedInstance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, curve);
}
///
/// If IsClosed, just return true. Otherwise, decide if curve can be closed as
/// follows: Linear curves polylinear curves with 2 segments, Nurbs with 3 or less
/// control points cannot be made closed. Also, if tolerance > 0 and the gap between
/// start and end is larger than tolerance, curve cannot be made closed.
/// Adjust the curve's endpoint to match its start point.
///
///
/// If nonzero, and the gap is more than tolerance, curve cannot be made closed.
///
/// true on success, false on failure.
public static bool MakeClosed(this Curve curve, out Curve updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, curve, tolerance);
}
///
/// Find parameter of the point on a curve that is locally closest to
/// the testPoint. The search for a local close point starts at
/// a seed parameter.
///
/// A point to test against.
/// The seed parameter.
/// >Parameter of the curve that is closest to testPoint.
/// true if the search is successful, false if the search fails.
public static bool LcoalClosestPoint(this Curve curve, Point3d testPoint, double seed, out double t)
{
return ComputeServer.Post(ApiAddress(), out t, curve, testPoint, seed);
}
///
/// Finds parameter of the point on a curve that is closest to testPoint.
/// If the maximumDistance parameter is > 0, then only points whose distance
/// to the given point is <= maximumDistance will be returned. Using a
/// positive value of maximumDistance can substantially speed up the search.
///
/// Point to search from.
/// Parameter of local closest point.
/// true on success, false on failure.
public static bool ClosestPoint(this Curve curve, Point3d testPoint, out double t)
{
return ComputeServer.Post(ApiAddress(), out t, curve, testPoint);
}
///
/// Finds the parameter of the point on a curve that is closest to testPoint.
/// If the maximumDistance parameter is > 0, then only points whose distance
/// to the given point is <= maximumDistance will be returned. Using a
/// positive value of maximumDistance can substantially speed up the search.
///
/// Point to project.
/// parameter of local closest point returned here.
/// The maximum allowed distance.
/// Past this distance, the search is given up and false is returned.
/// Use 0 to turn off this parameter.
/// true on success, false on failure.
public static bool ClosestPoint(this Curve curve, Point3d testPoint, out double t, double maximumDistance)
{
return ComputeServer.Post(ApiAddress(), out t, curve, testPoint, maximumDistance);
}
///
/// Gets closest points between this and another curves.
///
/// The other curve.
/// The point on this curve. This out parameter is assigned during this call.
/// The point on other curve. This out parameter is assigned during this call.
/// true on success; false on error.
public static bool ClosestPoints(this Curve curve, Curve otherCurve, out Point3d pointOnThisCurve, out Point3d pointOnOtherCurve)
{
return ComputeServer.Post(ApiAddress(), out pointOnThisCurve, out pointOnOtherCurve, curve, otherCurve);
}
///
/// Computes the relationship between a point and a closed curve region.
/// This curve must be closed or the return value will be Unset.
/// Both curve and point are projected to the World XY plane.
///
/// Point to test.
/// Relationship between point and curve region.
public static PointContainment Contains(this Curve curve, Point3d testPoint)
{
return ComputeServer.Post(ApiAddress(), curve, testPoint);
}
///