Lagrange
Loading...
Searching...
No Matches
RoundedPlaneOptions Struct Reference

Options for generating a rounded plane mesh. More...

#include <lagrange/primitive/generate_rounded_plane.h>

Inheritance diagram for RoundedPlaneOptions:
PrimitiveOptions

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.
 

Public Attributes

Scalar width = 1
 Width of the plane along the X-axis.
 
Scalar height = 1
 Height of the plane along the Z-axis.
 
Scalar bevel_radius = 0
 Radius of the bevel/rounding applied to the plane corners.
 
Index width_segments = 1
 Number of subdivisions along the width (X-axis).
 
Index height_segments = 1
 Number of subdivisions along the height (Z-axis).
 
Index bevel_segments = 8
 Number of subdivisions for the bevel/rounded corners.
 
std::array< Scalar, 3 > normal = {0, 0, 1}
 Unit normal vector for the plane.
 
- 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.
 

Detailed Description

Options for generating a rounded plane mesh.

Member Function Documentation

◆ project_to_valid_range()

void project_to_valid_range ( )
inline

Clamps all parameters to valid ranges.

This method ensures that:

  • width and height are non-negative
  • bevel_radius is non-negative and at most half the minimum of width and height
  • width_segments and height_segments are at least 1
  • bevel_segments is at least 1 when bevel_radius > epsilon, or 0 otherwise

Member Data Documentation

◆ width

Scalar width = 1

Width of the plane along the X-axis.

Must be non-negative.

◆ height

Scalar height = 1

Height of the plane along the Z-axis.

Must be non-negative.

◆ bevel_radius

Scalar bevel_radius = 0

Radius of the bevel/rounding applied to the plane corners.

A value of 0 creates sharp corners. The bevel radius is automatically clamped to at most half the minimum of width and height.

◆ width_segments

Index width_segments = 1

Number of subdivisions along the width (X-axis).

Must be at least 1.

◆ height_segments

Index height_segments = 1

Number of subdivisions along the height (Z-axis).

Must be at least 1.

◆ bevel_segments

Index bevel_segments = 8

Number of subdivisions for the bevel/rounded corners.

Higher values create smoother rounded corners. This parameter is ignored if bevel_radius is 0 or smaller than epsilon. Must be at least 1 when bevel_radius > epsilon.


The documentation for this struct was generated from the following file: