torus

Function defining the surface characteristic of a torus

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Function torus computes the X, Y and Z arrays to visualize a torus with model Torus. The left image below shows a torus with R = 0.5 m and r = 0.2 m. The right images below shows the torus with the additional parameter settings:

opening    =   45 degree
startAngle = -135 degree
stopAngle  =  135 degree

Syntax

(X, Y, Z, C) = torus(nu, nv, multiColoredSurface, R, r, opening, startAngle, stopAngle)

Inputs (8)

nu

Type: Integer

Description: Number of points in u-Dimension

nv

Type: Integer

Description: Number of points in v-Dimension

multiColoredSurface

Default Value: false

Type: Boolean

Description: = true: Color is defined for each surface point

R

Default Value: 1

Type: Length (m)

Description: Major radius (distance from center of torus to center of tube)

r

Default Value: 0.2

Type: Length (m)

Description: Minor radius (radius of tube)

opening

Default Value: 0

Type: Angle (rad)

Description: Opening angle of torus

startAngle

Default Value: -Modelica.Constants.pi

Type: Angle (rad)

Description: Start angle of torus slice

stopAngle

Default Value: Modelica.Constants.pi

Type: Angle (rad)

Description: End angle of torus slice

Outputs (4)

X

Type: Position[nu,nv] (m)

Description: [nu,nv] positions of points in x-Direction resolved in surface frame

Y

Type: Position[nu,nv] (m)

Description: [nu,nv] positions of points in y-Direction resolved in surface frame

Z

Type: Position[nu,nv] (m)

Description: [nu,nv] positions of points in z-Direction resolved in surface frame

C

Type: Real[if multiColoredSurface then nu else 0,if multiColoredSurface then nv else 0,3]

Description: [nu,nv,3] Color array, defining the color for each surface point