![]() |
ImFusion SDK 4.3
|
Creates common mesh primitives with normals. More...
Creates common mesh primitives with normals.
Functions | |
| Mesh * | createTubularMesh (const std::vector< vec3 > ¢erLine, const std::vector< double > &radius, int samples, std::vector< vec3 > *samplePoints=0, std::vector< vec3 > *sampleNormals=0, const std::vector< vec3 > &colors={}, bool closeEnds=false) |
| Create tubular mesh given a center line and a radius. | |
| Mesh * | createTubularMesh (const std::vector< vec3 > ¢erLine, const std::vector< vec3 > &normal, const std::vector< double > &radius, int samples) |
| Create tubular mesh given a center line, normals and a radius. Samples specifies the number of segments for one tube revolution. | |
| Mesh * | createTubularMesh (const std::vector< std::vector< vec3 > > &loops, bool close=false) |
| Create tubular mesh given individual loop data. | |
| Mesh * | createPyramid (const vec3 &tip, const vec3 &baseP1, const vec3 &baseP2, const vec3 &baseP3, const vec3 &baseP4) |
| Create a pyramid. | |
| Mesh * | createPyramid (double width, double height, bool createTextureCoordinates=false) |
| Create a pyramid This is a shortcut for createCone() with four sides. | |
| Mesh * | createCone (double majorRadius, double minorRadius, double height, int samples=32, bool createTextureCoordinates=false) |
| Create a cone with given major radius, minor radius and height. | |
| Mesh * | createBox (const vec3 &extent, bool createTextureCoordinates=false) |
| Create a centered box with given extent. | |
| Mesh * | createBoundingBox (const vec3 ¢er, const vec3 &extent, const mat3 &orientation=mat3::Identity(), bool createTextureCoordinates=false) |
| Create mesh depicting a bounding box with chosen center and extent. | |
| Mesh * | createCylinder (const vec3 ¢er, const vec3 &axis, double radius, double height, int samples, vec3 *color=nullptr, bool createTextureCoordinates=false) |
| Create a closed cylinder mesh Optionally texture coordinates can be created. | |
| Mesh * | createIcosahedron (double radius, bool smooth=false) |
| Create an icosahedron, which is a 12 vertices, 20 faces mesh. | |
| Mesh * | createIcosphere (double radius, int numSubdivisions=1, bool smooth=false) |
| Create an icosphere, generated by recursive-downsampling of an icosahedron; has a more even distribution of vertices around the surface. | |
| Mesh * | createSphere (double radius, int samples=32, bool createTextureCoordinates=false) |
| Create a sphere mesh with the chosen radius and number of samples along Z (it uses twice as many in radial X/Y direction) Optionally the sphere can be created with (halfedge) texture coordinates following a equirectangular projection. | |
| Mesh * | createEllipsoid (const vec3 &radius, int samples=32, bool createTextureCoordinates=false) |
| Create an ellipsoid; if only one radius is different, it is advised to use Z for that and rotate afterwards Optionally the ellipsoid can be created with (halfedge) texture coordinates following a equirectangular projection. | |
| Mesh * | createLineProjectedMesh (const GlLine *line, GlImplicitlyPlanarPointBasedAnnotation *base) |
| Create a prism, using a planar annotation as base, and a line to determine projection axis and height. | |
| Mesh * | createRectangularGrid (const vec2 dimension, const vec2i gridDivisions=vec2i::Zero()) |
| Creates a grid in the XY plane and normal of +Z, with the given dimensions. | |
| std::unique_ptr< Mesh > | createClosedSplineSurface (const GlSpline &spline) |
| Creates a surface mesh filling the inside of a closed spline, and texturizes it with a checkerboard pattern using the spline's color and transparency. | |
| Mesh * createTubularMesh | ( | const std::vector< vec3 > & | centerLine, |
| const std::vector< double > & | radius, | ||
| int | samples, | ||
| std::vector< vec3 > * | samplePoints = 0, | ||
| std::vector< vec3 > * | sampleNormals = 0, | ||
| const std::vector< vec3 > & | colors = {}, | ||
| bool | closeEnds = false ) |
Create tubular mesh given a center line and a radius.
Samples specifies the number of segments for one tube revolution. The normals are computed internally.
| Mesh * createCone | ( | double | majorRadius, |
| double | minorRadius, | ||
| double | height, | ||
| int | samples = 32, | ||
| bool | createTextureCoordinates = false ) |
Create a cone with given major radius, minor radius and height.
Axis are X, Y and Z respectively. Optionally texture coordinates can be created. If this is the case a distortion-free parametrization is computed that unwraps the cone shell and base onto a texture map. The shell is unwrapped on the left side of the texture with the base next to it. The whole parametrization is rescaled into a 1x1 square.
| Mesh * createBox | ( | const vec3 & | extent, |
| bool | createTextureCoordinates = false ) |
Create a centered box with given extent.
This is a shortcut for createBoundingBox() without specifying center and orientation
| Mesh * createBoundingBox | ( | const vec3 & | center, |
| const vec3 & | extent, | ||
| const mat3 & | orientation = mat3::Identity(), | ||
| bool | createTextureCoordinates = false ) |
Create mesh depicting a bounding box with chosen center and extent.
The column vectors of the optional orientation matrix define the basis of the bounding box. The basis must be right handed and normalized, i.e. the determinate of mat3 must be 1 or otherwise nullptr is returned. By default the box is axis-aligned. Optionally texture coordinates can be created. If this is the case a distortion-free parametrization is computed that unwraps the cube to the common "sideways t" texture map, where the aspect ratio of the leftmost face is extent[0]/extent[2], the second is extent[1]/extent[2] and so on, scaled appropriately to fit in a 1x1 square.
| Mesh * createCylinder | ( | const vec3 & | center, |
| const vec3 & | axis, | ||
| double | radius, | ||
| double | height, | ||
| int | samples, | ||
| vec3 * | color = nullptr, | ||
| bool | createTextureCoordinates = false ) |
Create a closed cylinder mesh Optionally texture coordinates can be created.
If this is the case a distortion-free parametrization is computed that unwraps the cylinder into disjoint shell and cap surfaces placed in a common texture map. If the height is greate than the cylinder circumference the discs are placed next to the shell in the texture map, otherwise they are placed above.
| Mesh * createIcosahedron | ( | double | radius, |
| bool | smooth = false ) |
Create an icosahedron, which is a 12 vertices, 20 faces mesh.
| radius | radius of the sphere the object fits into |
| Mesh * createIcosphere | ( | double | radius, |
| int | numSubdivisions = 1, | ||
| bool | smooth = false ) |
Create an icosphere, generated by recursive-downsampling of an icosahedron; has a more even distribution of vertices around the surface.
| radius | radius of the sphere |
| numSubdivisions | number of downsampling passes on the icosahedron |
| Mesh * createRectangularGrid | ( | const vec2 | dimension, |
| const vec2i | gridDivisions = vec2i::Zero() ) |
Creates a grid in the XY plane and normal of +Z, with the given dimensions.
Positive division splits the rectangular mesh into 2^k x 2^l rectangle patches to create a graph topology for meshing. (vec2i gridDivisions = (k,l))
| std::unique_ptr< Mesh > createClosedSplineSurface | ( | const GlSpline & | spline | ) |
Creates a surface mesh filling the inside of a closed spline, and texturizes it with a checkerboard pattern using the spline's color and transparency.
Calls Polygon2D::triangulate() internally.