Attributes

The attributes of a geometric object are

  • color::Color: a color given by its rgb components
  • size::Color: a number (::Float64) indicatingthe size of points or of a curve
  • field: a function, a type or an array describing a field on the object.

They are attributed by providing key=value parameters in the construction of the object or by assignement

obj[:key]=value

Color

SemiAlgebraicTypes.ColorType

Color represented by the r, g, b components (Int64 between 0 and 255) and a transparency component t (Float64 between 0.0 and 1.0).

source

Here is an example of a sphere, with the attribute color set to the red color.

S = sphere(point(0.,1.,0.), 0.5, color=Color(255,0,0))

Color

Fields

SemiAlgebraicTypes.DirFieldType

Scalar field described by a vector dir. The field value at a point is obtained by taking the scalar product with the vector.

source

Here is an example of a cylinder, with a directional field for the direction [1,1,0].

C = cylinder(point(0.,0.,0.), point(0.,1.,0.), 0.5, field=DirField(1.,1.,0.))

DirField

C = cone(point(0.,0.,0.), point(0.,1.,0.), 0.5, field=DistField(0.5,0.,0.))

DistField

A field can also be described by an array of values, attached for instance to the vertices of a mesh.

C = cube(point(0.,0.,0.), 0.5, field=[Float64(i) for i in 1:8])

DistField