Trunk#

A trunk is a generalized truncated cone. To define a trunk, give a surface, namely a polygonal surface (Polygon , Triangle , Quadrangle , Parallelogram , Rectangle , or SquareGeo ), or an elliptical surface (Ellipse or Disk ). To define the other surface, give a point of this surface (\(origin\)) and the scale factor according to the first surface.

For a trunk with polygonal basis, \(origin\) is the equivalent of the first vertex of the surface given, as it can be seen on the following figure of a trunk with triangular basis. The triangle being defined by its vertices \(v_1\), \(v_2\) and \(v_3\), \(origin\) is the equivalent of \(v_1\):

Figure made with TikZ

Figure made with TikZ

To construct a Trunk geometry with polygonal basis, use the parameter _basis to define the basis, the parameter _origin to define \(origin\), and the parameter _scale to define the scale factor.

_basis takes any surface object : Polygon , Triangle , Quadrangle , Parallelogram , Rectangle , SquareGeo , Ellipse or Disk . _origin takes a point or a single value (in this case, it is like a 1D point). _scale takes one single positive value.

For a trunk with elliptical basis, \(origin\) is the center of the second basis, as it can be seen on the following figure of a trunk with elliptical basis.

Figure made with TikZ

Figure made with TikZ

To construct a Trunk geometry with elliptical basis, use parameters _center1, _v1, _v2, _center2 taking a point or a single value (in this case, it is like a 1D point) and _scale taking a value. _center1, _v1 and _v2 are used as for a Ellipse or Disk object (see Ellipse or Disk for details). _center2 is used in this case instead of _origin, as it is the center of the second basis.

_nnodes can take one single value, an explicit list of 3 or \(n\) values or a Numbers object, where \(n\) is 3 times the number of edges of the basis. _hsteps can take one real value, an explicit list of \(p\) real values or a Reals object, where \(p\) is the number of points defining the trunk.

If required, give names of main domain and side domains as explained in Geometry definition:

Trunk t1(_basis=Triangle(_v1=Point(0.,0.,0.), _v2=Point(3.,0.,0.), _v3=Point(0.,2.,0.)), _origin=Point(0.,2.,1.), _scale=0.5, _nnodes={10, 10, 10, 5, 5, 5, 20, 20, 20}, _domain_name="Omega", _side_names={"Gamma", "Gamma", "Sigma", "Sigma", "Sigma"});
Trunk t2(_basis=Triangle(_v1=Point(0.,0.,0.), _v2=Point(3.,0.,0.),_v3=Point(0.,2.,0.)), _origin=Point(0.,2.,1.), _scale=0.5,_nnodes={10, 5, 20}, _domain_name="Omega",_side_names={"Gamma", "Gamma", "Sigma", "Sigma", "Sigma"});

These are 2 definitions of the same Trunk object, explaining the ability to give 3 values for _nnodes , instead of 9.

Let’s summarize information about geometrical keys on trunks:

key(s)

authorized types

examples

_basis

Polygon , Triangle , Quadrangle , Parallelogram , Rectangle , SquareGeo , Ellipse , Disk

_basis = xlifepp::Triangle (....)

_origin

Point

_origin = xlifepp::Point (0.,0.,0.)

_scale

single unsigned integer or real positive value

_scale =2, _scale =0.5

_center1, _center2, _v1, _v2

Point

_center1 = xlifepp::Point (0.,0.,0.)

Particular trunks (cylinder, prism, cone, pyramid, ...) are handled by classes inheriting from Trunk class: