Canvas3DItem:
Filter:
Canvas3D/Classes (extension) | GUI > 3D

Canvas3DItem
ExtensionExtension

A 3D vector graphics item

Description

Canvas3DItem provides wire-frame 3D vector graphics items for use with Canvas3D

Class Methods

.new

Create a new item.

Returns:

A new instance.

.cube

Create a 2x2x2 cube centered around [0,0,0]. You can then use -transform to change it's size, position and rotation.

Returns:

A new instance.

.grid

Create a flat NxN grid centered around [0,0,0], spanning [-1,-1,0] to [1,1,0].

Returns:

A new instance.

.regPrism

Create a prism.

Returns:

A new instance.

Instance Methods

Properties

.paths

Get/set the array of paths, where each path is an array of 3D vectors: [x,y,z]

Discussion:

For example, two lines:

.color

Get/set the item Color

.width

Get/set the item line-width.

.fill

Get/set the Boolean flag for stroking versus filling the item's path. See Pen: *stroke and Pen: *fill.

Transformations

.transforms

An array of transformation matrices to be applied when displayed in the canvas.

See Canvas3D: matrix_transforms.

Discussion:

These transforms are applied dynamically in the canvas each time it's refreshed. They don't alter the items paths in place.

Example:

.transform

Apply a transformation matrix on this items paths.

Arguments:

matrix

A matrix. See Canvas3D: matrix_transforms.

Discussion:

This transform is applied on the actual paths, and is a static one-time operation.

Example:

Examples

See Canvas3D: examples