|
Lagrange
|
Options for generating a rounded cone mesh. More...
#include <lagrange/primitive/generate_rounded_cone.h>
Public Types | |
| using | Scalar = PrimitiveOptions::Scalar |
| using | Index = size_t |
Public Types inherited from PrimitiveOptions | |
| using | Scalar = float |
Public Member Functions | |
| void | project_to_valid_range () |
| Clamps all parameters to valid ranges. | |
| std::pair< Scalar, Scalar > | get_max_cone_bevel () const |
| Computes the maximum allowable bevel radii for the cone geometry. | |
Public Attributes | |
| Scalar | radius_top = 0 |
| Radius of the cone at the top. Set to 0 for a traditional cone. | |
| Scalar | radius_bottom = 1 |
| Radius of the cone at the bottom. | |
| Scalar | height = 1 |
| Height of the cone along the Y-axis. | |
| Scalar | bevel_radius_top = 0 |
| Radius of the bevel/rounding applied to the top edge. | |
| Scalar | bevel_radius_bottom = 0 |
| Radius of the bevel/rounding applied to the bottom edge. | |
| Index | radial_sections = 32 |
| Number of radial subdivisions around the cone circumference. | |
| Index | bevel_segments_top = 1 |
| Number of segments used to approximate the top rounded edge. | |
| Index | bevel_segments_bottom = 1 |
| Number of segments used to approximate the bottom rounded edge. | |
| Index | side_segments = 1 |
| Number of segments along the cone's side surface (height direction). | |
| Index | top_segments = 1 |
| Number of radial segments on the top cap when radius_top > 0. | |
| Index | bottom_segments = 1 |
| Number of radial segments on the bottom cap when radius_bottom > 0. | |
| Scalar | start_sweep_angle = 0 |
| Starting angle for partial cone generation (in radians). | |
| Scalar | end_sweep_angle = static_cast<Scalar>(2 * lagrange::internal::pi) |
| Ending angle for partial cone generation (in radians). | |
Public Attributes inherited from PrimitiveOptions | |
| std::array< Scalar, 3 > | center {0, 0, 0} |
| Center of the primitive in 3D space. | |
| bool | with_top_cap = true |
| Whether to generate top cap of the primitive (if applicable). | |
| bool | with_bottom_cap = true |
| Whether to generate bottom cap of the primitive (if applicable). | |
| bool | with_cross_section = true |
| Whether to generate cross section of the primitive (if applicable). | |
| bool | triangulate = false |
| Whether to triangulate the generated surface mesh. | |
| bool | fixed_uv = false |
| Whether to use fixed UV coordinates regardless of the primitive parameters. | |
| std::string_view | normal_attribute_name = "@normal" |
| Name of the output indexed attribute storing the normal vectors. | |
| std::string_view | uv_attribute_name = "@uv" |
| Name of the output indexed attribute storing the UV coordinates. | |
| std::string_view | semantic_label_attribute_name = "@semantic_label" |
| Name of the output facet attribute storing the semantic labels. | |
| Scalar | dist_threshold = static_cast<Scalar>(1e-6) |
Two vertices are considered coinciding if the distance between them is smaller than dist_threshold. | |
| Scalar | angle_threshold = static_cast<Scalar>(30 * lagrange::internal::pi / 180) |
An edge is considered sharp if its dihedral angle is larger than angle_threshold. | |
| Scalar | epsilon = static_cast<Scalar>(1e-6) |
| Numerical tolerance used for comparing Scalar values. | |
| Scalar | uv_padding = static_cast<Scalar>(0.005) |
| Padding size for UV charts to avoid bleeding. | |
Options for generating a rounded cone mesh.
|
inline |
Clamps all parameters to valid ranges.
This method ensures that:
The bevel radius constraints are computed based on cone geometry to prevent invalid configurations where bevels would overlap or exceed the cone dimensions.
|
inline |
Computes the maximum allowable bevel radii for the cone geometry.
This function calculates geometric constraints on bevel radii based on the cone's dimensions and slope. The maximum bevel radius is limited by both the radius at each end and the cone's height to prevent geometric inconsistencies.
| Scalar bevel_radius_top = 0 |
Radius of the bevel/rounding applied to the top edge.
A value of 0 creates a sharp edge.
| Scalar bevel_radius_bottom = 0 |
Radius of the bevel/rounding applied to the bottom edge.
A value of 0 creates a sharp edge.
| Index radial_sections = 32 |
Number of radial subdivisions around the cone circumference.
Higher values create smoother circular cross-sections.
| Index bevel_segments_top = 1 |
Number of segments used to approximate the top rounded edge.
Only relevant when bevel_radius_top > 0.
| Index bevel_segments_bottom = 1 |
Number of segments used to approximate the bottom rounded edge.
Only relevant when bevel_radius_bottom > 0.
| Scalar start_sweep_angle = 0 |
Starting angle for partial cone generation (in radians).
0 corresponds to the positive X-axis.
| Scalar end_sweep_angle = static_cast<Scalar>(2 * lagrange::internal::pi) |
Ending angle for partial cone generation (in radians).
Default of 2π creates a full cone.