Class: CustomCurveSurface

sceneObjs.CustomCurveSurface()

A custom surface whose shape is a sequence of cubic Bezier curves. Can be drawn as an open polyline (finish by double-clicking the last anchor) or a closed shape (finish by clicking the first anchor).

The incident position parameter t exposed to the outgoing-ray equations is the natural parameter of the polyBezier: if the incident point lies at local parameter t_local (in [0, 1]) of the i-th Bezier segment (0- indexed in the order the user clicked the anchors), then the exposed parameter is t = i + t_local. The parameter is not arc-length uniform.

Tools -> Other -> Custom Bezier Surface

Constructor

new CustomCurveSurface()

Properties:
Name Type Description
points Array.<object>

The anchor/control points of the Bezier curves (managed by CurveObjMixin).

curves Array.<object>

The Bezier curves forming the surface.

bboxes Array.<object>

Cached bounding boxes of the curves.

notDone boolean

Whether the user is still drawing the path.

isClosed boolean

Whether the curve forms a closed loop.

outRays Array.<OutRay>

The expressions of the outgoing rays.

twoSided boolean

Whether the surface is two-sided.

Source:

Extends

  • BaseCustomSurface

Methods

traceOffsetPath(canvasRenderer, offset)

Build a sub-path tracing each Bezier curve offset by offset units along its normal. Offsetting is done by sampling each curve and connecting the samples with straight line segments, which is a good approximation for small offsets (such as half the stroke width) and is robust for nearly degenerate curves (where Bezier#offset can fail).

Parameters:
Name Type Description
canvasRenderer CanvasRenderer
offset number
Source: