Class: SurfaceBuilder
SurfaceBuilder is a factory class that provides static methods for constructing surfaces from curves, points, and other geometric inputs. Like CurveBuilder, you never instantiate it -- just call its static methods directly (e.g., SurfaceBuilder.loft(...), SurfaceBuilder.revolve(...)).
When to use SurfaceBuilder
Use SurfaceBuilder when you need to create a surface from scratch:
- Extruding a curve in a direction to form a flat or ruled surface
- Revolving a profile curve around an axis to create surfaces of revolution
- Lofting between multiple cross-section curves for smooth transitions
- Sweeping profiles along a spine curve (single rail or two rails)
- Building surfaces from points, edges, or curve networks
- Creating primitives like rectangular or circular planar surfaces
- Piping a curve with a constant or variable radius
Once created, the resulting Surface objects can be further manipulated using the methods on the Surface class (fillet, offset, boolean operations, paneling, etc.).
Quick start
Key methods
| Method | Description |
|---|---|
extrudePoint(curve, direction) | Extrude a curve in a direction |
extrudeAlong(base, profile) | Extrude a base curve along a profile curve |
revolve(curve, origin, dir, angle) | Revolve a curve around an axis |
loft(curves, degree) | Loft a smooth surface through cross-section curves |
sweep(profiles, spine) | Sweep profiles along a single spine curve |
sweep2(profiles, rail1, rail2) | Sweep profiles along two rail curves |
pipe(curve, radius) | Create a pipe surface around a curve |
pipeVariable(curve, radii, params) | Pipe with variable radius along the curve |
surface4Pnt(p1, p2, p3, p4) | Surface defined by four corner points |
circleSurface(origin, radius) | Planar circular surface |
rectangularSurface(origin, w, l) | Planar rectangular surface |
surfaceFromCurves(curveList) | Surface from a network of curves |
surfaceFromPoints(pointList) | Surface interpolating through points |
surfaceByEdges(curveList) | Surface by lofting between edge curves |
mesh(pA, pB, pC) | Triangular mesh face from three points |
delaunayMesh(points) | Delaunay triangulation mesh from points |
sumSrf(crv1, crv2) | Sum surface of two curves |
Static Method: surface4Pnt
Creates a surface based on four given points.
Parameters
point1(IVector): The first point.point2(IVector): The second point.point3(IVector): The third point.point4(IVector): The fourth point.
Returns
A new Surface object representing the created surface.
Example
Static Method: loft
Creates a lofted surface from the given curves.
Parameters
curves(ICurve[]): The curves to loft.degree(number): The degree of the lofted surface.
Returns
A new Surface object representing the lofted surface.
Example
Static Method: extrudePoint
Extrudes a curve in a specified direction.
Parameters
curve(ICurve): The curve to extrude the point along.direction(IVector): The direction in which to extrude the point.
Returns
A new Surface object representing the extruded surface.
Example
Static Method: extrudeAlong
Extrudes a base curve along a profile curve to create a surface.
Parameters
base(ICurve): No descriptionprofileCurve(ICurve): No description
Returns
The resulting surface.
Example
Static Method: sweep
Creates a swept surface by sweeping a set of profiles along a spine curve.
Parameters
profiles(ICurve[]): An array of curves representing the profiles to be swept.spine(ICurve): The spine curve along which the profiles will be swept.
Returns
A new Surface object representing the swept surface.
Example
Static Method: sweep2
Creates a swept surface by sweeping profiles along two rails.
Parameters
profiles(ICurve[]): An array of curves representing the profiles to be swept.rail1(ICurve): The first rail curve.rail2(ICurve): The second rail curve.
Returns
A Surface object representing the swept surface.
Example
Static Method: sumSrf
Calculates the sum surface of two curves.
Parameters
crv1(ICurve): The first curve.crv2(ICurve): The second curve.
Returns
A new Surface object representing the sum surface of the two curves.
Example
Static Method: revolve
Revolves a curve around an axis to create a surface.
Parameters
curve(ICurve): The curve to revolve.origin(IVector): The origin point of the axis.direction(IVector): The direction vector of the axis.angle(number): The angle of revolution in radians.
Returns
A new Surface object representing the revolved surface.
Example
Static Method: pipe
Creates a pipe surface based on the given curve and radius.
Parameters
curve(ICurve): The curve to create the pipe from.radius(number): The radius of the pipe.
Returns
A new Surface object representing the pipe surface.
Example
Static Method: pipeVariable
Builds a pipe surface by extruding a curve along a set of radii and parameters.
Parameters
curve(ICurve): The curve to be extruded.radii(number[]): An array of radii corresponding to each parameter.parameters(number[]): An array of parameters specifying the position along the curve for each radius.
Returns
A new Surface object representing the resulting pipe surface.
Example
Static Method: circleSurface
Creates a circular surface with the given origin and radius.
Parameters
origin(IVector): The origin point of the circle.radius(number): The radius of the circle.
Returns
A Surface object representing the circular surface.
Example
Static Method: rectangularSurface
Creates a rectangular surface with the specified origin, width, and length.
Parameters
origin(IVector): The origin point of the surface.width(number): The width of the surface.length(number): The length of the surface.
Returns
A Surface object representing the rectangular surface.
Example
Static Method: surfaceByEdges
Builds a surface by creating a loft between the given curves.
Parameters
curveList(ICurve[]): The list of curves to create the surface from.
Returns
A Surface object representing the constructed surface.
Example
Static Method: surfaceFromCurves
Creates a surface from a list of curves.
Parameters
curveList(ICurve[]): The list of curves to create the surface from.
Returns
A Surface object representing the created surface.
Example
Static Method: surfaceFromPoints
Creates a surface from a list of points.
Parameters
pointList(IVector[]): The list of points to create the surface from.
Returns
A Surface object representing the created surface.
Example
Static Method: mesh
Creates a mesh surface from three given points.
Parameters
pointA(IVector): The first point of the mesh.pointB(IVector): The second point of the mesh.pointC(IVector): The third point of the mesh.
Returns
A Surface object representing the mesh surface.
Example
Static Method: delaunayMesh
Generates a Delaunay mesh from the given points.
Parameters
points(IVector[]): An array of Vector points.
Returns
An array of Surface objects representing the Delaunay mesh.