Skip to content

Class: Shape3DMaker

A help class for quickly creating Shape3D related objects

Export

Constructors

Accessors

Methods

Constructors

constructor

new Shape3DMaker(renderer): Shape3DMaker

Parameters

NameType
rendererShape3DRenderer

Returns

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:25

Accessors

renderer

get renderer(): Shape3DRenderer

Returns

Shape3DRenderer

Defined in

packages/graphic/renderer/Shape3DMaker.ts:49

Methods

makeRenderer

makeRenderer(name, textureList, scene, maxNodeCount?, triangleEachNode?): Shape3DMaker

Parameters

NameTypeDefault valueDescription
namestringundefinedkey of Shape3DRenderer.
textureListBitmapTexture2DArrayundefinedtextures used by node.
sceneScene3DundefinedScene3D
maxNodeCount?number1000Can accommodate the maximum number of nodes
triangleEachNode?number24The maximum number of triangles included is triangleEachNode * maxNodeCount

Returns

Shape3DMaker

{Shape3DMaker}

Static

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:40


ellipse

ellipse(radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise?): EllipseShape3D

Create an ellipse in Shape3DRenderer

Parameters

NameType
radiusXnumber
radiusYnumber
rotationnumber
startAnglenumber
endAnglenumber
counterclockwise?boolean

Returns

EllipseShape3D

{EllipseShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:66


arc

arc(radius, startAngle, endAngle, counterclockwise?): CircleShape3D

Create an arc in Shape3DRenderer

Parameters

NameType
radiusnumber
startAnglenumber
endAnglenumber
counterclockwise?boolean

Returns

CircleShape3D

{CircleShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:87


line

line(points): LineShape3D

Create line segments in Shape3DRenderer

Parameters

NameType
pointsVector2[]

Returns

LineShape3D

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:103


quadraticCurve

quadraticCurve(fx, fy, cpx, cpy, tx, ty): QuadraticCurveShape3D

Create a quadratic curve in Shape3DRenderer

Parameters

NameType
fxnumber
fynumber
cpxnumber
cpynumber
txnumber
tynumber

Returns

QuadraticCurveShape3D

{QuadraticCurveShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:127


curve

curve(fx, fy, cp1x, cp1y, cp2x, cp2y, tx, ty): CurveShape3D

Create a curve in Shape3DRenderer

Parameters

NameType
fxnumber
fynumber
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
txnumber
tynumber

Returns

CurveShape3D

{CurveShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:149


path2D

path2D(): Path2DShape3D

Create a path2D in Shape3DRenderer. Through the Path2DShape3D, you can use the CanvasPath API for path drawing on xz plane.

Returns

Path2DShape3D

{Path2DShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:165


path3D

path3D(): Path3DShape3D

Create a path3D in Shape3DRenderer. Through the Path3DShape3D, you can use the similar CanvasPath API for path drawing in 3D space.

Returns

Path3DShape3D

{Path3DShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:175


rect

rect(w, h): RoundRectShape3D

Create a rect in Shape3DRenderer

Parameters

NameType
wnumber
hnumber

Returns

RoundRectShape3D

{RoundRectShape3D}

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:187


roundRect

roundRect(w, h, radii?): RoundRectShape3D

Create a RoundRect in Shape3DRenderer

Parameters

NameType
wnumber
hnumber
radii?number

Returns

RoundRectShape3D

Memberof

Shape3DMaker

Defined in

packages/graphic/renderer/Shape3DMaker.ts:206