Class: SurfaceBuilder

The SurfaceBuilder class provides static methods for constructing surfaces using various algorithms and operations.

Constructors

new SurfaceBuilder()

new SurfaceBuilder(): SurfaceBuilder

Returns

SurfaceBuilder

Methods

circleSurface()

static circleSurface(origin, radius): Surface

Creates a circular surface with the given origin and radius.

Parameters

origin: Vector

The origin point of the circle.

radius: number

The radius of the circle.

Returns

Surface

A Surface object representing the circular surface.


delaunayMesh()

static delaunayMesh(points, plane?): Surface[]

Generates a Delaunay mesh from the given points.

Parameters

points: Vector[]

An array of Vector points.

plane?: Plane

An optional Plane object.

Returns

Surface[]

An array of Surface objects representing the Delaunay mesh.


extrudeAlong()

static extrudeAlong(base, profileCurve): Surface

Extrudes a base curve along a profile curve to create a surface.

Parameters

base: Curve

The base curve to extrude.

profileCurve: Curve

The profile curve to extrude along the base curve.

Returns

Surface

The resulting surface.


extrudePoint()

static extrudePoint(curve, direction): Surface

Extrudes a curve in a specified direction.

Parameters

curve: Curve

The curve to extrude the point along.

direction: Vector

The direction in which to extrude the point.

Returns

Surface

A new Surface object representing the extruded surface.


loft()

static loft(curves, degree): Surface

Creates a lofted surface from the given curves.

Parameters

curves: Curve[]

The curves to loft.

degree: number

The degree of the lofted surface.

Returns

Surface

A new Surface object representing the lofted surface.


mesh()

static mesh(pointA, pointB, pointC): Surface

Creates a mesh surface from three given points.

Parameters

pointA: Vector

The first point of the mesh.

pointB: Vector

The second point of the mesh.

pointC: Vector

The third point of the mesh.

Returns

Surface

A Surface object representing the mesh surface.


pipe()

static pipe(curve, radius): Surface

Creates a pipe surface based on the given curve and radius.

Parameters

curve: Curve

The curve to create the pipe from.

radius: number

The radius of the pipe.

Returns

Surface

A new Surface object representing the pipe surface.


pipeVariable()

static pipeVariable(curve, radii, parameters): Surface

Builds a pipe surface by extruding a curve along a set of radii and parameters.

Parameters

curve: Curve

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

Surface

A new Surface object representing the resulting pipe surface.


rectangularSurface()

static rectangularSurface(origin, width, length): Surface

Creates a rectangular surface with the specified origin, width, and length.

Parameters

origin: Vector

The origin point of the surface.

width: number

The width of the surface.

length: number

The length of the surface.

Returns

Surface

A Surface object representing the rectangular surface.


revolve()

static revolve(curve, origin, direction, angle): Surface

Revolves a curve around an axis to create a surface.

Parameters

curve: Curve

The curve to revolve.

origin: Vector

The origin point of the axis.

direction: Vector

The direction vector of the axis.

angle: number

The angle of revolution in radians.

Returns

Surface

A new Surface object representing the revolved surface.


sumSrf()

static sumSrf(crv1, crv2): Surface

Calculates the sum surface of two curves.

Parameters

crv1: Curve

The first curve.

crv2: Curve

The second curve.

Returns

Surface

A new Surface object representing the sum surface of the two curves.


surface4Pnt()

static surface4Pnt(point1, point2, point3, point4): Surface

Creates a surface based on four given points.

Parameters

point1: Vector

The first point.

point2: Vector

The second point.

point3: Vector

The third point.

point4: Vector

The fourth point.

Returns

Surface

A new Surface object representing the created surface.


surfaceByEdges()

static surfaceByEdges(curveList): Surface

Builds a surface by creating a loft between the given curves.

Parameters

curveList: Curve[]

The list of curves to create the surface from.

Returns

Surface

A Surface object representing the constructed surface.


surfaceFromCurves()

static surfaceFromCurves(curveList): Surface

Creates a surface from a list of curves.

Parameters

curveList: Curve[]

The list of curves to create the surface from.

Returns

Surface

A Surface object representing the created surface.


surfaceFromPoints()

static surfaceFromPoints(pointList): Surface

Creates a surface from a list of points.

Parameters

pointList: Vector[]

The list of points to create the surface from.

Returns

Surface

A Surface object representing the created surface.


sweep()

static sweep(profiles, spine): Surface

Creates a swept surface by sweeping a set of profiles along a spine curve.

Parameters

profiles: Curve[]

An array of curves representing the profiles to be swept.

spine: Curve

The spine curve along which the profiles will be swept.

Returns

Surface

A new Surface object representing the swept surface.


sweep2()

static sweep2(profiles, rail1, rail2): Surface

Creates a swept surface by sweeping profiles along two rails.

Parameters

profiles: Curve[]

An array of curves representing the profiles to be swept.

rail1: Curve

The first rail curve.

rail2: Curve

The second rail curve.

Returns

Surface

A Surface object representing the swept surface.

Throws

An error if the sweep could not be created.

Constructors
new SurfaceBuilder()
Methods
circleSurface()
delaunayMesh()
extrudeAlong()
extrudePoint()
loft()
mesh()
pipe()
pipeVariable()
rectangularSurface()
revolve()
sumSrf()
surface4Pnt()
surfaceByEdges()
surfaceFromCurves()
surfaceFromPoints()
sweep()
sweep2()