geometry functions

geometry.angle function

Syntax

  • float geometry.angle(angleType)

Parameters

  1. angleTypeselector
    Selector for the angle calculation.
    • maxSlope—Calculates the maximum slope of the shape, relative to the xz-plane, in degrees.
    • azimuth—Calculates the azimuth of the direction of the current shape's maximum slope, in degrees;
    • zenith—Calculates the difference between 90 degrees (zenith) and the maximum slope.

Returns

Angle of the current shape's geometry, depending on the selector, in degrees.

Description

The geometry.angle function calculates the angle of current shape's geometry. azimuth is the horizontal angle measured clockwise from the north, i.e. 90 degrees is east, 180 degrees is south and 270 degrees is west. The Azimuth is in the range [0, 360]. The geometry.angle(zenith) function returns the same value as 90 - geometry.angle(maxSlope)

Examples

Cone-->
    comp(f) { all : color(geometry.angle(maxSlope)/ 90,
              0.0, 0.0) Shape. }
geometry.angle (maxSlope)
Cone-->
    comp(f) { all : color(0.5, geometry.angle(azimuth)/ 360,
              0.5) Shape. }

geometry.angle (azimuth)

geometry.area function

Syntax

  • float geometry.area()
  • float geometry.area(faceOrientation)

Parameters

  1. faceOrientationselector
    Selector for the faces to include in the area calculation.
    • {surface| all } (default)
    • { front | back | left | right | top | bottom | side }
    • { object.front | object.back | object.left | object.right | object.top | object.bottom | object.side }
    • { world.south | world.north | world.west | world.east | world.up | world.down | world.side }
    • { street.front | street.back | street.left | street.right | street.side }

Returns

Surface area of the current shape's geometry, depending on the provided faceOrientation selector.

Description

The geometry.area function calculates the surface area that is the sum of all its faces.

geometry.boundaryLength

Syntax

  • float geometry.boundaryLength()

Returns

The sum of all boundary edge lengths. An edge is considered a boundary edge if it belongs to no more than one face.

Related

geometry.{du|dv} functions

Syntax

  • float geometry.du(uvSet, surfaceParameterization)
  • float geometry.dv(uvSet, surfaceParameterization)

Parameters

  1. uvSetfloat
    Number of texture coordinates set (integer number [0,9]). The numbering corresponds to the texture layers of the material attribute, see also Texturing: essential knowledge.
  2. surfaceParameterizationselector

    The surface parameter space.

    • uvSpace—Selects the actual texture coordinates (typically in the range [0,1]).
    • unitSpace —Calculates the geometry-dependent surface stretch along the u- or v- axis and calculates an approximation in world coordinate units (e.g. meters).

Returns

The range (i.e. max - min) spanned by the u- or the v-coordinate, respectively, of the selected uvset.

Related

geometry.groups

Syntax

  • string[] geometry.groups()

Returns

An array with group names.

Note:

The order of groups in the array corresponds to the order given by the indexed component split for groups. In other words, the index of an element in the array corresponds to the component index.

Related

geometry.hasTags function

Syntax

  • bool geometry.hasTags()
  • bool geometry.hasTags(tagQuery)

Parameters

  1. tagQuerystring
    The query defining which tags to consider. See also Geometry Tagging: Essential Knowledge.

Returns

true if any geometry component (face, edge or vertex) has tags, false otherwise. If a tagQuery is provided, only matching tags are considered.

Related

geometry.hasUVs function

Syntax

  • bool geometry.hasUVs()
  • bool geometry.hasUVs(uvSet)

Parameters

  1. uvSetfloat

    Number of texture coordinates set (integer number in [0,9]). The numbering corresponds to the texture layers of the material attribute, see also Texturing: Essential Knowledge.

Returns

true if the geometry has UVs, false otherwise. If a uvSet is provided, only the respective UVs are considered.

geometry.height function

Syntax

  • float geometry.height()

Returns

The height of the geometry in world coordinates.

Related

geometry.isClosedSurface function

Syntax

  • bool geometry.isClosedSurface()

Returns

true if the geometry contains at least one face and all edges belong to exactly 2 faces, false otherwise.

Related

geometry.isConcave function

Syntax

  • bool geometry.isConcave()

Returns

true if the geometry contains at least one concave face, false otherwise.

Related

geometry.isInstanced function

Syntax

  • bool geometry.isInstanced()

Returns

True if the current shape's geometry is the instance of an asset, i.e. the geometry has not been altered since the insert operation, false otherwise.

Description

The geometry.isInstanced function can be used to e.g. check if an inserted asset was trimmed.

Related

geometry.isOriented function

Syntax

  • bool geometry.isOriented(orientation)

Parameters

  1. orientationselector
    Selector for the faces to check for.
    • { front | back | left | right | top | bottom | side }
    • { object.front | object.back | object.left | object.right | object.top | object.bottom | object.side }
    • { world.south | world.north | world.west | world.east | world.up | world.down | world.side }
    • { street.front | street.back | street.left | street.right | street.side }

Returns

True if at least one of the geometry's faces matches the orientation selector, false otherwise.

Description

The geometry.isOriented function can be used to determine a shape's orientation.

Related

geometry.isPlanar function

Syntax

  • bool geometry.isPlanar(tolerance)

Parameters

  1. tolerancefloat
    The tolerance in degrees for deciding if an face is planar or not. The face normal is compared to the edges' cross product (''local normal'') at every vertex; if the angle between a ''local normal'' and the face normal is larger than the tolerance the face is non-planar. A reasonable value is 0.25 degrees.

Returns

true if the geometry contains at least one face and all faces of are planar (within tolerance), false otherwise).

Related

geometry.isRectangular function

Syntax

  • bool geometry.isRectangular(tolerance)

Parameters

  1. tolerancefloat
    The tolerance in degrees for deciding if an angle is a right one or not.

Returns

true if the geometry contains at least one face and all faces consist of 4 vertices and contain only right angles, false otherwise. Angles in the range [90-tolerance, 90+tolerance] are considered to be "right".

Related

geometry.materials

Syntax

  • string[] geometry.materials()

Returns

An array with material names.

Note:

The order of materials in the array corresponds to the order given by the indexed component split for groups. In other words, the index of an element in the array corresponds to the component index.

Related

geometry.nEdges function

Syntax

  • float geometry.nEdges()

Returns

The (integral) number of edges of the current shape's geometry.

Related

geometry.nFaces function

Syntax

  • float geometry.nFaces()

Returns

The (integral) number of faces of the current shape's geometry.

Related

geometry.nHoles function

Syntax

  • float geometry.nHoles()

Returns

The (integral) number of holes (i.e. holes in faces) of the current shape's geometry.

Related

geometry.nVertices function

Syntax

  • float geometry.nVertices()

Returns

The (integral) number of vertices of the current shape's geometry.

Related

geometry.tags function

Syntax

  • string[] geometry.tags()
  • string[] geometry.tags(tagQuery)

Parameters

  1. tagQuerystring
    The query defining which tags to include in the result. See also Geometry Tagging: Essential Knowledge.

Returns

An array with alphabetically sorted tags. If a tagQuery is provided, only matching tags are included.

Note:

Includes each unique tag stored on a face, edge or vertex component of the geometry.

Related

geometry.{uMin|uMax|vMin|vMax} functions

Syntax

  • float geometry.uMin()
  • float geometry.uMax()
  • float geometry.vMin()
  • float geometry.vMax()
  • float geometry.uMin(uvSet)
  • float geometry.uMax(uvSet)
  • float geometry.vMin(uvSet)
  • float geometry.vMax(uvSet)

Parameters

  1. uvSetfloat
    Number of texture coordinates set (integer number in [0,9]). The numbering corresponds to the texture layers of the material attribute, see also Texturing: essential knowledge.

Returns

The minimal or maximal u or v value of the selected uvset (the versions without parameter use uvset 0).

geometry.volume function

Syntax

  • float geometry.volume()

Returns

Volume of the current shape's geometry.

Related