23#ifndef VCL_ALGORITHMS_MESH_CREATE_AXIS_H
24#define VCL_ALGORITHMS_MESH_CREATE_AXIS_H
33template<FaceMeshConcept MeshType>
34MeshType createAxisCylinder(
double unitLength,
bool fromOrigin =
false)
36 const double cylLength = fromOrigin ? unitLength : unitLength * 2;
37 const double cylRadius = cylLength * 0.0025;
39 const double coneRadius = cylRadius * 10;
40 const double coneLength = cylLength * 0.1;
42 const double firstSphereRadius = unitLength * 0.02;
43 const double commonSphereRadius = unitLength * 0.008;
48 vcl::translate(cylinder,
vcl::Point3d(0, unitLength * 0.5, 0));
51 vcl::updatePerVertexNormals(cylinder);
56template<FaceMeshConcept MeshType>
57MeshType createAxisConeSpheres(
double unitLength,
bool fromOrigin =
false)
59 const double cylLength = fromOrigin ? unitLength : unitLength * 2;
60 const double cylRadius = cylLength * 0.0025;
62 const double coneRadius = cylRadius * 10;
63 const double coneLength = cylLength * 0.1;
65 const double firstSphereRadius = unitLength * 0.02;
66 const double commonSphereRadius = unitLength * 0.008;
69 double transl = unitLength + (coneLength * 0.5);
75 coneSpheres.append(sp);
78 for (uint i = 0; i < 9; ++i) {
79 const double step = unitLength * 0.1;
80 const double x = step + i * step;
83 coneSpheres.append(sp);
87 coneSpheres.append(sp);
91 const double rad = fromOrigin ? firstSphereRadius : commonSphereRadius;
94 coneSpheres.append(sp);
96 vcl::updatePerVertexNormals(coneSpheres);
103template<FaceMeshConcept MeshType>
104std::pair<MeshType, MeshType> createAxisDisjoint(
105 double unitLength = 1,
106 bool fromOrigin =
false)
108 return std::make_pair(
109 detail::createAxisCylinder<MeshType>(unitLength, fromOrigin),
110 detail::createAxisConeSpheres<MeshType>(unitLength, fromOrigin));
113template<FaceMeshConcept MeshType>
114MeshType createAxis(
double unitLength = 1,
bool fromOrigin =
false)
117 detail::createAxisCylinder<MeshType>(unitLength, fromOrigin);
120 detail::createAxisConeSpheres<MeshType>(unitLength, fromOrigin));
The Point class represents an N-dimensional point containing N scalar values.
Definition point.h:58
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43