Class: Surface

Raphael3d. Surface

represents surface composed of faces

new Surface(vertices, faces, paper)

Surface implementation, currently only convex shapes are supported (non-convex surfaces can be composed from several convex ones)
This:
Parameters:
Name Type Argument Description
vertices Array.<Raphael3d.Vertex> array of vertices of the surface
faces Array.<Raphael3d.Face> array of faces of the surface
paper Raphael.Paper <optional>
raphael paper instance
Properties:
Name Type Description
vertices Array.<Raphael3d.Vertex> array of vertices of the surface
faces Array.<Raphael3d.Face> array of faces
projectedNormals Array.<Raphael3d.Vector3> array of projected normals of faces
wireframe Paper.el wireframe (one paper.path for all non-backface edges)
wireframeBackface Paper.el (one paper.parh for all backface edges)
material Raphael3d.Material material of receiver
isConvex boolean indicated if surface is convex or not
isDoubleSided boolean indicated if surface is double sided or not
transparency number transparency of receiver (from 0 to 1)
isDoubleSided boolean if receiver is double sided. If yes, it is rendered always, if not, only whan projectedNormal has positive z cordinate
aabb Raphael3d.AABB receiver's axis aligned bounding box
aabbProjected Raphael3d.AABB aabb of receiver's projection
coveredByList Array list of objects receiver is covered by (defined by the user)
path Raphael.el paper.path instance (only for visibility order reasons)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1521

Methods

<static> Box(x0, y0, z0, dx, dy, dz, paper, faceAttrs) → {Raphael3d.Surface}

Creates new Surface of axis aligned box shape
Parameters:
Name Type Argument Description
x0 number x coordinate
y0 number y coordinate
z0 number z coordinate
dx number x size
dy number y size
dz number z size
paper Raphael.Paper paper
faceAttrs Object <optional>
face attribues passed to face.attr()
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2000
Returns:
new Surface object of box shape
Type
Raphael3d.Surface

<static> create(vertices, faces, paper) → {Raphael3d.Surface}

Creates new Surface object. See Raphael3d.Surface for arguments
Parameters:
Name Type Description
vertices Array.<Raphael3d.Vertex>
faces Array.<Raphael3d.Face>
paper Raphael.Paper
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1550
Returns:
new Surface object
Type
Raphael3d.Surface

<static> Prism(x, y, z, r, h, n, paper, faceAttrs) → {Raphael3d.Surface}

Creates new Surface of z aligned regular multigonal prism shape
Parameters:
Name Type Argument Description
x number x coordinate of the canter of the base
y number y coordinate of the canter of the base
z number z coordinate of the canter of the base
r number radius of the base
h number height
n number number of vertices in the base
paper Raphael.Paper paper
faceAttrs Object <optional>
face attribues passed to face.attr()
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2051
Returns:
new Surface object of prism shape
Type
Raphael3d.Surface

<static> Pyramid(x, y, z, r, h, n, paper, faceAttrs) → {Raphael3d.Surface}

Creates new Surface of z aligned regular miltigonal pyramid shape
Parameters:
Name Type Argument Description
x number x coordinate of the canter of the base
y number y coordinate of the canter of the base
z number z coordinate of the canter of the base
r number radius of the base
h number height
n number number of vertices in the base
paper Raphael.Paper paper
faceAttrs Object <optional>
face attribues passed to face.attr()
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2106
Returns:
new Surface object of pyramid shape
Type
Raphael3d.Surface

<static> Tetrahedron(x, y, z, dx, dy, dz, paper, faceAttrs) → {Raphael3d.Surface}

Creates new Surface of axis aligned tetrahedron shape
Parameters:
Name Type Argument Description
x number x coordinate
y number y coordinate
z number z coordinate
dx number x size
dy number y size
dz number z size
paper Raphael.Paper paper
faceAttrs Object <optional>
face attribues passed to face.attr()
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1960
Returns:
new Surface object of tetrahedron shape
Type
Raphael3d.Surface

hideWireframe() → {Raphael3d.Surface}

Hides wireframe
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1570
Returns:
receiver
Type
Raphael3d.Surface

isCoveredBy(b) → {boolean}

Checks if receiver is covered by given object (i.e. if the given object is present in initially empty coveredByList attribute, filled by the user)
Parameters:
Name Type Description
b Raphael3d.Edge | Raphael3d.Face | Raphael3d.Surface given object
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1943
Returns:
true if receiver is covered by given object, false otherwise
Type
boolean

isProjectedZParallel()

Returns false, for compatibility reasons
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1540

orderFaces()

Order projected faces of receiver. Current implementation only for convex surfaces (nun-convex shapes can be composed of several convex ones)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1811

project(m) → {Raphael3d.Surface}

Projects receiver (i.e. changes projected coordinates of vertices) according to given matrix
Parameters:
Name Type Description
m Raphael3d.Matrix4x4 projection matrix
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1597
Returns:
receiver
Type
Raphael3d.Surface

render() → {Raphael3d.Surface}

Renders receiver (i.e. wireframes and faces)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1631
Returns:
receiver
Type
Raphael3d.Surface

renderFaces()

Renders faces of receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1640

renderWireframe()

Renders wireframes
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1672

renderWireframeBackface()

Render backface wireframe
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1710

scale(sx, sy, sz) → {Raphael3d.Surface}

Scale receiver (changes real coordinates of vertices)
Parameters:
Name Type Description
sx number scale factor in x direction
sy number scale factor in y direction
sz number scale factor in z direction
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1793
Returns:
receiver
Type
Raphael3d.Surface

setDoubleSidedTo(d) → {Raphael3d.Surface}

Set isDoubleSided of receiver (and all faces) to given value
Parameters:
Name Type Description
d boolean
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1558
Returns:
receiver
Type
Raphael3d.Surface

setMaterial(material) → {Raphael3d.Surface}

Sets new material to the receiver
Parameters:
Name Type Description
material Raphael3d.Material new material
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1851
Returns:
receiver
Type
Raphael3d.Surface

setWireframe(wireframe) → {Raphael3d.Surface}

Sets new wireframe to the receiver
Parameters:
Name Type Description
wireframe Raphael.el new wireframe
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1842
Returns:
receiver
Type
Raphael3d.Surface

shear(shxy, shyz, shzx) → {Raphael3d.Surface}

Shear receiver (changes real coordinates of vertices)
Parameters:
Name Type Description
shxy number shear factor in xy plane
shyz number shear factor in yz plane
shzx number shear factor in zx plane
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1804
Returns:
receiver
Type
Raphael3d.Surface

showWireframe() → {Raphael3d.Surface}

Shows wireframe
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1583
Returns:
receiver
Type
Raphael3d.Surface

transform(m)

Transforms receiver (i.e. change real coordinates of vertices) according to given matrix
Parameters:
Name Type Description
m Raphael3d.Matrix4x4 transformation matrix
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1768
Returns:
receiver

translate(tx, ty, tz) → {Raphael3d.Surface}

Translate receiver (changes real coordinates of vertices)
Parameters:
Name Type Description
tx number translation in x direction
ty number translation in y direction
tz number translation in z direction
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1782
Returns:
receiver
Type
Raphael3d.Surface

update(material) → {Raphael3d.Surface}

Updates receiver (its faces) with given material
Parameters:
Name Type Argument Description
material Raphael3d.Material <optional>
material of update. If ommited, this.material will be used instead
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1610
Returns:
receiver
Type
Raphael3d.Surface

updateAABB() → {Raphael3d.Surface}

Updates AABB (axis aligned bounding box) of the receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1859
Returns:
receiver
Type
Raphael3d.Surface

updateFaceNormals()

Updates normals of faces
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1655

updateFaces(material)

Updates faces of receiver (compute normals, update and order) with given material
Parameters:
Name Type Argument Description
material Raphael3d.Material <optional>
material of update. If ommited, this.material will be used instead
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 1618