### MeshGLOptions::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGLOptions.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates an empty MeshGLOptions instance, suitable for starting the builder pattern. ```APIDOC ## MeshGLOptions::new ### Description Create empty mesh-construction options. ### Method `new()` ### Returns - `Self`: An empty `MeshGLOptions` instance. ``` -------------------------------- ### Basic Manifold Operations Example Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/index.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Demonstrates creating a cube and a cylinder, performing a difference operation, and asserting the resulting volume. ```Rust use manifold_csg::Manifold; let cube = Manifold::cube(10.0, 10.0, 10.0, true); let hole = Manifold::cylinder(20.0, 3.0, 3.0, 32, false).translate(0.0, 0.0, -10.0); let result = &cube - &hole; assert!(result.volume() < cube.volume()); ``` -------------------------------- ### MeshGLOptions::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGLOptions.html?search=std%3A%3Avec Creates an empty MeshGLOptions instance. This is the starting point for configuring mesh construction options. ```APIDOC ## MeshGLOptions::new ### Description Creates empty mesh-construction options. ### Signature `pub const fn new() -> Self` ### Returns A new, empty `MeshGLOptions` instance. ``` -------------------------------- ### MeshGL64Options::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64Options.html?search=std%3A%3Avec Creates an empty MeshGL64Options struct, suitable for starting mesh construction with default settings. ```APIDOC ## MeshGL64Options::new ### Description Creates empty mesh-construction options. ### Method `new()` ### Returns - `Self`: An instance of `MeshGL64Options` with default values. ``` -------------------------------- ### Force CSG Tree Evaluation with Context (Example Usage) Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/manifold.rs.html?search=u32+-%3E+bool Example of forcing CSG tree evaluation using `with_context` and checking the status. Requires `ExecutionContext` and `Manifold` types. ```rust let ctx = ExecutionContext::new(); manifold.with_context(&ctx).status()?; ``` -------------------------------- ### Get Execution Progress Source: https://docs.rs/manifold-csg/latest/manifold_csg/execution/struct.ExecutionContext.html?search=std%3A%3Avec Returns the progress of an in-flight evaluation as a fraction in the range `[0.0, 1.0]`. This value is meaningful only after the context has been attached to a manifold and an eager operation has started. ```rust pub fn progress(&self) -> f64 ``` -------------------------------- ### Create MeshGL with Options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=std%3A%3Avec Creates a MeshGL instance with additional options for run, merge, and tangent metadata. Handles potential errors from malformed input buffers. ```rust pub fn new_with_options( vert_props: &[f32], n_props: usize, tri_indices: &[u32], options: MeshGLOptions<'_>, ) -> Result ``` -------------------------------- ### num_run Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Gets the number of triangle runs. ```APIDOC ## num_run ### Description Returns the total number of triangle runs in the mesh. ### Returns - `usize`: The count of triangle runs. ``` -------------------------------- ### Create MeshGL64 with Options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Initializes a MeshGL64 with optional run, merge, and tangent metadata. This method validates the mesh and metadata buffers for malformations. ```rust pub fn new_with_options( vert_props: &[f64], n_props: usize, tri_indices: &[u64], options: MeshGL64Options<'_>, ) -> Result ``` -------------------------------- ### num_run Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=std%3A%3Avec Gets the number of triangle runs. ```APIDOC ## num_run ### Description Gets the number of triangle runs. ### Method `pub fn num_run(&self) -> usize` ### Returns The number of triangle runs as a `usize`. ``` -------------------------------- ### CrossSection::num_contour Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=u32+-%3E+bool Gets the number of contours in the cross-section. ```APIDOC ## CrossSection::num_contour ### Description Number of contours. ### Returns - `usize`: The total number of contours in the cross-section. ``` -------------------------------- ### CrossSection::num_vert Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=u32+-%3E+bool Gets the number of vertices in the cross-section. ```APIDOC ## CrossSection::num_vert ### Description Number of vertices. ### Returns - `usize`: The total number of vertices in the cross-section. ``` -------------------------------- ### pub fn from_sdf_with_context( ctx: &ExecutionContext, f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ) -> Self where F: Fn(f64, f64, f64) -> f64 + Sync Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=std%3A%3Avec Constructs a manifold from an SDF, reporting progress and observing cancellation through an ExecutionContext. Similar to `from_sdf` but integrates with context for progress and cancellation. ```APIDOC ## pub fn from_sdf_with_context( ctx: &ExecutionContext, f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ) -> Self where F: Fn(f64, f64, f64) -> f64 + Sync ### Description Constructs a manifold from an SDF, reporting progress and observing cancellation through an ExecutionContext. Similar to `from_sdf` but integrates with context for progress and cancellation. ### Method `from_sdf_with_context` ### Parameters * `ctx` (*ExecutionContext) - The execution context for progress and cancellation. * `f` (Fn(f64, f64, f64) -> f64 + Sync) - The signed distance function closure. * `bounds` (([f64; 3], [f64; 3])) - The bounding box for the SDF evaluation. * `edge_length` (f64) - The approximate edge length of the output mesh. * `level` (f64) - The isosurface level (typically 0.0). * `tolerance` (f64) - The tolerance for surface accuracy. ``` -------------------------------- ### BoundingBox Methods Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/bounding_box.rs.html?search=std%3A%3Avec This section details the various methods available for interacting with BoundingBox objects, including creation, property retrieval, and spatial queries. ```APIDOC ## BoundingBox ### Description A 3D axis-aligned bounding box. Wraps the manifold3d `Box` type, providing spatial queries (containment, overlap), combining operations (union, expand), and transforms. Obtain a `BoundingBox` from [`Manifold::bounding_box`](crate::Manifold::bounding_box), or construct one directly from min/max coordinates. ### Methods #### `new(min: [f64; 3], max: [f64; 3]) -> BoundingBox` Create a bounding box from min and max corners. - **min** (`[f64; 3]`) - The minimum corner coordinates [x, y, z]. - **max** (`[f64; 3]`) - The maximum corner coordinates [x, y, z]. #### `min(&self) -> [f64; 3]` Get the minimum corner `[x, y, z]` of the bounding box. #### `max(&self) -> [f64; 3]` Get the maximum corner `[x, y, z]` of the bounding box. #### `dimensions(&self) -> [f64; 3]` Get the dimensions `[width, height, depth]` of the bounding box. #### `center(&self) -> [f64; 3]` Get the center point `[x, y, z]` of the bounding box. #### `scale(&self) -> f64` Get the maximum distance from the center to any corner (half-diagonal). #### `is_empty(&self) -> bool` Check if the box is empty (all dimensions are zero or negative). #### `is_finite(&self) -> bool` Check if the box has finite (non-infinite, non-NaN) bounds. #### `contains_point(&self, point: [f64; 3]) -> bool` Check if the box fully contains the given point. - **point** (`[f64; 3]`) - The point to check. #### `contains_box(&self, other: &BoundingBox) -> bool` Check if this box fully contains another box. - **other** (`&BoundingBox`) - The other bounding box to check. #### `overlaps_point(&self, point: [f64; 3]) -> bool` Check if the box overlaps with a point (same as contains for points). - **point** (`[f64; 3]`) - The point to check. #### `overlaps_box(&self, other: &BoundingBox) -> bool` Check if this box overlaps with another box. - **other** (`&BoundingBox`) - The other bounding box to check. ``` -------------------------------- ### tolerance Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=std%3A%3Avec Gets the tolerance used for merging and vertex welding. ```APIDOC ## tolerance ### Description Gets the tolerance used for merging and vertex welding. ### Method `pub fn tolerance(&self) -> f64` ### Returns The tolerance as an `f64`. ``` -------------------------------- ### impl Any for T Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides the `type_id` method to get the `TypeId` of an object. ```APIDOC ## fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ``` -------------------------------- ### MeshGLOptions::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGLOptions.html?search=u32+-%3E+bool Creates an empty MeshGLOptions instance, which can then be configured with specific metadata. ```APIDOC ## MeshGLOptions::new ### Description Create empty mesh-construction options. ### Method `new()` ### Returns - `Self`: An empty `MeshGLOptions` instance. ``` -------------------------------- ### get_circular_segments Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/fn.get_circular_segments.html?search=u32+-%3E+bool Get the number of circular segments for a given radius. ```APIDOC ## Function get_circular_segments ### Description Get the number of circular segments for a given radius. ### Signature ```rust pub fn get_circular_segments(radius: f64) -> i32 ``` ### Parameters * **radius** (f64) - The radius to calculate circular segments for. ### Returns * (i32) - The number of circular segments. ``` -------------------------------- ### Get Number of Triangles Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the total count of triangles in the mesh. ```rust pub fn num_tri(&self) -> usize ``` -------------------------------- ### Create MeshGL64 with Options Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search= Constructs a MeshGL64 with specified vertex properties, triangle indices, and optional metadata like runs, merge vertices, and tangents. Includes validation for mesh shape and options. ```rust pub fn new_with_options( vert_props: &[f64], n_props: usize, tri_indices: &[u64], options: MeshGL64Options<'_>, ) -> Result { validate_mesh_shape(vert_props.len(), n_props, tri_indices.len())?; let n_verts = vert_props.len() / n_props; let n_tris = tri_indices.len() / 3; validate_meshgl64_options(n_tris, tri_indices.len(), options)?; let (run_indices, run_original_ids) = options.runs.unwrap_or((&[], &[])); let (merge_from, merge_to) = options.merge_vertices.unwrap_or((&[], &[])); let halfedge_tangents = options.halfedge_tangents.unwrap_or(&[]); let sys_options = ManifoldMeshGL64Options { run_indices: slice_ptr(run_indices), run_indices_length: run_indices.len(), run_original_ids: slice_ptr(run_original_ids), run_original_ids_length: run_original_ids.len(), merge_from_vert: slice_ptr(merge_from), merge_to_vert: slice_ptr(merge_to), merge_verts_length: merge_from.len(), halfedge_tangents: slice_ptr(halfedge_tangents), }; // SAFETY: manifold_alloc_meshgl64 returns a valid handle. let ptr = unsafe { manifold_alloc_meshgl64() }; // SAFETY: ptr is valid. All slices outlive the call and were validated. unsafe { manifold_meshgl64_w_options( ptr, vert_props.as_ptr(), n_verts, n_props, tri_indices.as_ptr(), n_tris, &sys_options, ); } Ok(Self { ptr }) } ``` -------------------------------- ### MeshGL64::new_with_options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=u32+-%3E+bool Creates a MeshGL64 with optional run, merge, and tangent metadata. ```APIDOC ## MeshGL64::new_with_options ### Description Create a MeshGL64 with optional run, merge, and tangent metadata. ### Parameters #### Path Parameters - **vert_props** (slice of f64) - Required - Vertex properties. - **n_props** (usize) - Required - Number of properties per vertex. - **tri_indices** (slice of u64) - Required - Triangle indices. - **options** (MeshGL64Options) - Required - Optional metadata. #### Query Parameters None #### Request Body None ### Response #### Success Response (Result) - **Ok(MeshGL64)**: A new MeshGL64 object with options. - **Err(CsgError)**: An error if the input is invalid. ### Errors Returns `CsgError::InvalidInput` if the mesh buffers or metadata buffers are malformed. ``` -------------------------------- ### Get Number of Vertices Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the total number of vertices in the cross-section. ```rust let section = CrossSection::square(10.0, 10.0, false); let num_vertices = section.num_vert(); ``` -------------------------------- ### Create MeshGL with options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Construct a MeshGL object with additional options for run, merge, and tangent metadata. This provides flexibility in how the mesh data is structured and interpreted. ```rust pub fn new_with_options( vert_props: &[f32], n_props: usize, tri_indices: &[u32], options: MeshGLOptions<'_>, ) -> Result ``` -------------------------------- ### Get Number of Vertices Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=std%3A%3Avec Retrieves the total number of vertices in the cross-section. ```rust pub fn num_vert(&self) -> usize ``` -------------------------------- ### Create Empty MeshGL64Options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64Options.html?search=std%3A%3Avec Creates an empty MeshGL64Options instance. Use this when no specific construction options are needed. ```rust pub const fn new() -> Self ``` -------------------------------- ### Get CrossSection Area Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Calculates the total enclosed area of the cross-section. ```rust let section = CrossSection::square(10.0, 10.0, false); let area = section.area(); ``` -------------------------------- ### Get CrossSection Area Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=std%3A%3Avec Retrieves the total enclosed area of the cross-section. ```rust pub fn area(&self) -> f64 ``` -------------------------------- ### Create MeshGL with Options (Runs, Merges, Tangents) Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search= Constructs a MeshGL object with optional metadata including runs, merge information, and tangent data. Validates mesh shape and options against the number of triangles. ```rust pub fn new_with_options( vert_props: &[f32], n_props: usize, tri_indices: &[u32], options: MeshGLOptions<'_>, ) -> Result { validate_mesh_shape(vert_props.len(), n_props, tri_indices.len())?; let n_verts = vert_props.len() / n_props; let n_tris = tri_indices.len() / 3; validate_meshgl_options(n_tris, tri_indices.len(), options)?; let (run_indices, run_original_ids) = options.runs.unwrap_or((&[], &[])); let (merge_from, merge_to) = options.merge_vertices.unwrap_or((&[], &[])); let halfedge_tangents = options.halfedge_tangents.unwrap_or(&[]); let sys_options = ManifoldMeshGLOptions { run_indices: slice_ptr(run_indices), run_indices_length: run_indices.len(), run_original_ids: slice_ptr(run_original_ids), run_original_ids_length: run_original_ids.len(), merge_from_vert: slice_ptr(merge_from), merge_to_vert: slice_ptr(merge_to), merge_verts_length: merge_from.len(), halfedge_tangents: slice_ptr(halfedge_tangents), }; // SAFETY: manifold_alloc_meshgl returns a valid handle. let ptr = unsafe { manifold_alloc_meshgl() }; // SAFETY: ptr is valid. All slices outlive the call and were validated. unsafe { manifold_meshgl_w_options( ptr, vert_props.as_ptr(), n_verts, n_props, tri_indices.as_ptr(), n_tris, &sys_options, ); } Ok(Self { ptr }) } ``` -------------------------------- ### MeshGL64: Constructor with Tangents Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a MeshGL64 with halfedge tangent data. Requires valid mesh buffers and a correctly sized tangent buffer. ```rust /// Create a MeshGL64 with halfedge tangent data. /// /// See [`MeshGL::new_with_tangents`] for details. /// /// # Errors /// /// Returns [`CsgError::InvalidInput`] if the mesh buffers are malformed or /// the tangent buffer length is not `num_tri * 3 * 4`. pub fn new_with_tangents( vert_props: &[f64], n_props: usize, tri_indices: &[u64], halfedge_tangent: &[f64], ) -> Result { validate_mesh_shape(vert_props.len(), n_props, tri_indices.len())?; let n_verts = vert_props.len() / n_props; let n_tris = tri_indices.len() / 3; validate_tangent_len(halfedge_tangent.len(), n_tris)?; // SAFETY: manifold_alloc_meshgl64 returns a valid handle. let ptr = unsafe { manifold_alloc_meshgl64() }; // SAFETY: ptr valid, all slices valid with correct lengths. unsafe { manifold_meshgl64_w_tangents( ptr, vert_props.as_ptr(), n_verts, ``` -------------------------------- ### Any Implementation for T Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.Rect2.html?search=std%3A%3Avec Provides the type_id method for getting the TypeId of a type T. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Get Rect Dimensions Source: https://docs.rs/manifold-csg/latest/manifold_csg/rect/struct.Rect.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Calculates and returns the dimensions [width, height] of the rectangle. ```rust pub fn dimensions(&self) -> [f64; 2] ``` -------------------------------- ### nalgebra Convenience Methods Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/manifold.rs.html?search=std%3A%3Avec Offers convenience methods for users of the `nalgebra` crate, simplifying transformations and plane operations by accepting nalgebra types directly. ```APIDOC ## nalgebra Convenience Methods ### `transform_nalgebra` Apply a 3x3 rotation/scale matrix plus translation using nalgebra types. - **Method**: `Manifold::transform_nalgebra` - **Parameters**: - `matrix` (&nalgebra::Matrix3): The 3x3 rotation/scale matrix. - `translation` (&nalgebra::Vector3): The translation vector. - **Returns**: A new `Manifold` after transformation. ### `split_by_plane_nalgebra` Split the manifold into two halves along a plane defined by nalgebra types. - **Method**: `Manifold::split_by_plane_nalgebra` - **Parameters**: - `normal` (&nalgebra::Vector3): The normal vector of the plane. - `offset` (f64): The offset of the plane from the origin. - **Returns**: A tuple containing two `Manifold` objects representing the two halves. ### `trim_to_positive_side_nalgebra` Trim the manifold to the positive side of a plane defined by nalgebra types. - **Method**: `Manifold::trim_to_positive_side_nalgebra` - **Parameters**: - `normal` (&nalgebra::Vector3): The normal vector of the plane. - `offset` (f64): The offset of the plane from the origin. - **Returns**: A new `Manifold` trimmed to the positive side. ``` -------------------------------- ### Get Maximum Corner Source: https://docs.rs/manifold-csg/latest/manifold_csg/rect/struct.Rect.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the maximum corner coordinates [x, y] of the rectangle. ```rust pub fn max(&self) -> [f64; 2] ``` -------------------------------- ### MeshGL64::new_with_options Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=std%3A%3Avec Creates a MeshGL64 with optional run, merge, and tangent metadata. It validates input buffers and options before creating the mesh. ```APIDOC ## MeshGL64::new_with_options ### Description Creates a MeshGL64 with optional run, merge, and tangent metadata. It validates input buffers and options before creating the mesh. ### Parameters - `vert_props`: Slice of f64 representing vertex properties. - `n_props`: Number of properties per vertex. - `tri_indices`: Slice of u64 representing triangle indices. - `options`: `MeshGL64Options` struct containing optional metadata. ### Returns - `Result`: A `Result` containing the created `MeshGL64` on success, or a `CsgError::InvalidInput` if the buffers are malformed. ``` -------------------------------- ### Get Minimum Corner Source: https://docs.rs/manifold-csg/latest/manifold_csg/rect/struct.Rect.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the minimum corner coordinates [x, y] of the rectangle. ```rust pub fn min(&self) -> [f64; 2] ``` -------------------------------- ### MeshGL::new_with_options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a MeshGL object with optional metadata including run, merge, and tangent information. This offers more flexibility in mesh creation. ```APIDOC ## MeshGL::new_with_options ### Description Create a MeshGL with optional run, merge, and tangent metadata. ### Method `MeshGL::new_with_options(vert_props: &[f32], n_props: usize, tri_indices: &[u32], options: MeshGLOptions<'_>) -> Result` ### Parameters * `vert_props` (`&[f32]`) - A flat array of vertex properties. * `n_props` (`usize`) - The number of properties per vertex (minimum 3). * `tri_indices` (`&[u32]`) - A flat array of triangle indices. * `options` (`MeshGLOptions<'_>`) - An object containing optional mesh metadata. ### Errors Returns `CsgError::InvalidInput` if the mesh buffers or metadata buffers are malformed. ``` -------------------------------- ### MeshGL::new Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=u32+-%3E+bool Create a MeshGL from f32 vertex properties and u32 triangle indices. ```APIDOC ## MeshGL::new ### Description Create a [`MeshGL`](crate::mesh::MeshGL) from f32 vertex properties and u32 triangle indices. ### Parameters * `vert_props`: Slice of f32 vertex properties. Each vertex has 3 positions and 3 normals (6 floats total). * `tri_indices`: Slice of u32 triangle indices. Each triangle is defined by 3 indices into `vert_props`. * `options`: Optional [`MeshGLOptions`](crate::mesh::MeshGLOptions) for additional metadata. ### Returns A `Result` containing the created [`MeshGL`](crate::mesh::MeshGL) on success, or a [`CsgError`](crate::types::CsgError) on failure. ``` -------------------------------- ### CrossSection::bounds_rect2 Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=u32+-%3E+bool Gets the axis-aligned bounding rectangle as raw min/max values. ```APIDOC ## CrossSection::bounds_rect2 ### Description Axis-aligned bounding rectangle as raw min/max values. Convenience method returning a simple struct. For spatial queries, use `bounds` which returns a `Rect` with richer methods. ### Returns - `Rect2`: The raw bounding rectangle values. ``` -------------------------------- ### Get Number of Contours Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=std%3A%3Avec Retrieves the number of contours (rings) that make up the cross-section. ```rust pub fn num_contour(&self) -> usize ``` -------------------------------- ### ExecutionContext::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/execution/struct.ExecutionContext.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new ExecutionContext with zero progress and no cancellation requested. ```APIDOC ## ExecutionContext::new ### Description Create a fresh, un-cancelled context with zero progress. ### Method `new()` ### Returns - `Self`: A new `ExecutionContext` instance. ``` -------------------------------- ### ExecutionContext::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/execution/struct.ExecutionContext.html?search=u32+-%3E+bool Creates a new ExecutionContext with zero progress and no cancellation requested. ```APIDOC ## ExecutionContext::new ### Description Create a fresh, un-cancelled context with zero progress. ### Method `Self` ### Returns `Self` - A new ExecutionContext instance. ``` -------------------------------- ### Get Number of Vertices Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search= Returns the number of vertices in the mesh. Requires the mesh to be valid. ```rust pub fn num_vert(&self) -> usize { // SAFETY: self.ptr is valid (invariant). unsafe { manifold_meshgl64_num_vert(self.ptr) } } ``` -------------------------------- ### impl CloneToUninit for T Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides the `clone_to_uninit` method for experimental copy-assignment to uninitialized memory. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. ``` -------------------------------- ### Get Original ID Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=u32+-%3E+bool Retrieves the original ID assigned to this manifold for tracking through operations. ```APIDOC ## pub fn original_id(&self) -> i32 ### Description Original ID of this manifold (for tracking through operations). Use `original_id` to retrieve the assigned ID, and `reserve_ids` to pre-allocate ID ranges. ### Method `original_id` ### Returns The original ID of the manifold. ``` -------------------------------- ### MeshGL64::new_with_options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Constructs a MeshGL64 with additional metadata, including optional run, merge, and tangent information, allowing for more complex mesh configurations. ```APIDOC ## MeshGL64::new_with_options ### Description Create a MeshGL64 with optional run, merge, and tangent metadata. ### Method `pub fn new_with_options( vert_props: &[f64], n_props: usize, tri_indices: &[u64], options: MeshGL64Options<'_>, ) -> Result` ### Errors Returns `CsgError::InvalidInput` if the mesh buffers or metadata buffers are malformed. ``` -------------------------------- ### Get Number of Edges Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=u32+-%3E+bool Returns the total number of edges in the manifold's mesh. ```rust pub fn num_edge(&self) -> usize ``` -------------------------------- ### Get Rect Center Source: https://docs.rs/manifold-csg/latest/manifold_csg/rect/struct.Rect.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Computes and returns the center point coordinates [x, y] of the rectangle. ```rust pub fn center(&self) -> [f64; 2] ``` -------------------------------- ### SDF Implementation with Context Handling Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/manifold.rs.html?search=u32+-%3E+bool Internal implementation for SDF construction, handling both context-aware and non-context scenarios. Manages panic catching and FFI trampoline. ```rust fn from_sdf_impl( f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ec: *mut ManifoldExecutionContext, ) -> Self where F: Fn(f64, f64, f64) -> f64 + Sync, { struct Context<'a, F> { f: &'a F, panic: Mutex>, } unsafe extern "C" fn trampoline( x: f64, y: f64, z: f64, ctx: *mut std::ffi::c_void, ) -> f64 where F: Fn(f64, f64, f64) -> f64 + Sync, { let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { let ctx = unsafe { &*(ctx as *const Context<'_, F>) }; (ctx.f)(x, y, z) })); match result { Ok(distance) => distance, Err(payload) => { let ctx = unsafe { &*(ctx as *const Context<'_, F>) }; store_panic(&ctx.panic, payload); f64::MAX } } } let ctx = Context { f: &f, panic: Mutex::new(None), }; let ctx_ptr = &ctx as *const Context<'_, F> as *mut std::ffi::c_void; let box_ptr = unsafe { manifold_alloc_box() }; unsafe { manifold_box( box_ptr, bounds.0[0], bounds.0[1], bounds.0[2], bounds.1[0], bounds.1[1], bounds.1[2], ); } // SAFETY: manifold_alloc_manifold returns a valid handle. ``` -------------------------------- ### Create BoundingBox from Min/Max Corners Source: https://docs.rs/manifold-csg/latest/manifold_csg/bounding_box/struct.BoundingBox.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Constructs a new BoundingBox using the minimum and maximum corner coordinates. This is a fundamental way to initialize a bounding box. ```rust pub fn new(min: [f64; 3], max: [f64; 3]) -> Self ``` -------------------------------- ### Get Triangle Indices Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=std%3A%3Avec Copies and returns the triangle indices as a flat u32 array. ```rust pub fn tri_verts(&self) -> Vec ``` -------------------------------- ### Get Vertex Properties Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=std%3A%3Avec Copies and returns all vertex properties as a flat f32 array. ```rust pub fn vert_properties(&self) -> Vec ``` -------------------------------- ### MeshGL64: Constructor with Vertex Properties and Triangle Indices Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=std%3A%3Avec Creates a MeshGL64 instance from f64 vertex properties and u64 triangle indices. Validates input shapes and returns a Result. Requires valid mesh allocation and data pointers. ```rust pub fn new(vert_props: &[f64], n_props: usize, tri_indices: &[u64]) -> Result { validate_mesh_shape(vert_props.len(), n_props, tri_indices.len())?; let n_verts = vert_props.len() / n_props; let n_tris = tri_indices.len() / 3; // SAFETY: manifold_alloc_meshgl64 returns a valid handle. let ptr = unsafe { manifold_alloc_meshgl64() }; // SAFETY: ptr is valid, slices are valid with correct lengths. unsafe { manifold_meshgl64( ptr, vert_props.as_ptr(), n_verts, n_props, tri_indices.as_ptr(), n_tris, ); } Ok(Self { ptr }) } ``` -------------------------------- ### Create MeshGL from Vertex Properties and Indices Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=std%3A%3Avec Creates a MeshGL instance from flat arrays of vertex properties and triangle indices. Ensures the input data is well-formed. ```rust pub fn new( vert_props: &[f32], n_props: usize, tri_indices: &[u32], ) -> Result ``` -------------------------------- ### Get Tolerance Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=u32+-%3E+bool Returns the tolerance value of the manifold, which is distinct from the internal epsilon used for testing. ```APIDOC ## pub fn get_tolerance(&self) -> f64 ### Description Tolerance of the manifold (public API, distinct from the `epsilon` testing hook). ### Method `get_tolerance` ### Returns The tolerance value of the manifold. ``` -------------------------------- ### MeshGL::new_with_options Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL.html?search=u32+-%3E+bool Creates a MeshGL object with optional metadata including run, merge, and tangent information. This method allows for more complex mesh configurations. ```APIDOC ## MeshGL::new_with_options ### Description Creates a MeshGL with optional run, merge, and tangent metadata. ### Method `pub fn new_with_options( vert_props: &[f32], n_props: usize, tri_indices: &[u32], options: MeshGLOptions<'_>, ) -> Result` ### Parameters * `vert_props` ( &[f32] ) - Vertex properties as a flat array. * `n_props` ( usize ) - Number of properties per vertex. * `tri_indices` ( &[u32] ) - Triangle indices as a flat array. * `options` ( MeshGLOptions<'_> ) - Optional mesh metadata. ### Errors Returns `CsgError::InvalidInput` if the mesh buffers or metadata buffers are malformed. ``` -------------------------------- ### MeshGL64Options::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64Options.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates empty mesh-construction options for MeshGL64. ```APIDOC ## MeshGL64Options::new ### Description Creates empty mesh-construction options. ### Method `new()` ### Returns `Self` (a new `MeshGL64Options` instance) ``` -------------------------------- ### Get Epsilon Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=u32+-%3E+bool Returns the precision (epsilon) value used for floating-point comparisons within the manifold. ```APIDOC ## pub fn epsilon(&self) -> f64 ### Description Precision (epsilon) of the manifold. ### Method `epsilon` ### Returns The epsilon value of the manifold. ``` -------------------------------- ### Get Number of Triangle Runs Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the total count of triangle runs within the mesh. ```rust pub fn num_run(&self) -> usize ``` -------------------------------- ### ExecutionContext::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/execution/struct.ExecutionContext.html?search=std%3A%3Avec Creates a new ExecutionContext. This context is initially un-cancelled and has zero progress. ```APIDOC ## ExecutionContext::new ### Description Create a fresh, un-cancelled context with zero progress. ### Method `Self::new()` ### Returns - `Self` - A new `ExecutionContext` instance. ``` -------------------------------- ### BoundingBox::new Source: https://docs.rs/manifold-csg/latest/manifold_csg/bounding_box/struct.BoundingBox.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new BoundingBox from the minimum and maximum corner coordinates. ```APIDOC ## BoundingBox::new ### Description Create a bounding box from min and max corners. ### Method `new(min: [f64; 3], max: [f64; 3]) -> Self` ### Parameters * `min` ([f64; 3]) - The minimum corner coordinates [x, y, z]. * `max` ([f64; 3]) - The maximum corner coordinates [x, y, z]. ``` -------------------------------- ### Get Merging Tolerance Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the tolerance value used for merging vertices and welding operations. ```rust pub fn tolerance(&self) -> f64 ``` -------------------------------- ### Get Number of Properties Per Vertex Source: https://docs.rs/manifold-csg/latest/manifold_csg/mesh/struct.MeshGL64.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the number of properties associated with each vertex in the mesh. ```rust pub fn num_prop(&self) -> usize ``` -------------------------------- ### MeshGL64::new_with_options Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a MeshGL64 with optional run, merge, and tangent metadata. It validates the input buffers and options before creating the mesh. Errors are returned if the mesh buffers or metadata are malformed. ```APIDOC ## MeshGL64::new_with_options ### Description Creates a MeshGL64 with optional run, merge, and tangent metadata. It validates the input buffers and options before creating the mesh. Errors are returned if the mesh buffers or metadata are malformed. ### Method `pub fn new_with_options(vert_props: &[f64], n_props: usize, tri_indices: &[u64], options: MeshGL64Options<'_>) -> Result` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **vert_props** (`&[f64]`) - Required - Slice of vertex properties. - **n_props** (`usize`) - Required - Number of properties per vertex. - **tri_indices** (`&[u64]`) - Required - Slice of triangle indices. - **options** (`MeshGL64Options<'_>`) - Required - Options for mesh creation, including runs, merge vertices, and half-edge tangents. ### Request Example ```rust // Example usage (assuming MeshGL64Options and CsgError are defined) let vert_props = vec![0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]; let n_props = 3; let tri_indices = vec![0, 1, 2]; let options = MeshGL64Options { runs: None, merge_vertices: None, halfedge_tangents: None }; let mesh = MeshGL64::new_with_options(&vert_props, n_props, &tri_indices, options); ``` ### Response #### Success Response - **Self** (`MeshGL64`) - A new MeshGL64 instance. #### Response Example ```rust // Assuming mesh creation is successful // let mesh: MeshGL64 = ...; ``` #### Error Response - **CsgError::InvalidInput** - If the mesh buffers or metadata are malformed. ``` -------------------------------- ### Get Number of Contours Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Returns the number of distinct contours (including holes) within the cross-section. ```rust let section = CrossSection::square(10.0, 10.0, false); let num_contours = section.num_contour(); ``` -------------------------------- ### Create a New ExecutionContext Source: https://docs.rs/manifold-csg/latest/manifold_csg/execution/struct.ExecutionContext.html?search=std%3A%3Avec Creates a new ExecutionContext with zero progress and no cancellation requested. This is the initial state for observing operations. ```rust pub fn new() -> Self ``` -------------------------------- ### SDF Implementation Details Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/manifold.rs.html?search=std%3A%3Avec Internal implementation for SDF construction, handling context and panic catching. This function is not intended for direct use. ```rust /// Shared body for [`from_sdf`](Self::from_sdf) / /// [`from_sdf_with_context`](Self::from_sdf_with_context). A null `ec` /// selects the non-context `manifold_level_set`; a non-null `ec` selects /// the ctx-aware factory. fn from_sdf_impl( f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ec: *mut ManifoldExecutionContext, ) -> Self where F: Fn(f64, f64, f64) -> f64 + Sync, { struct Context<'a, F> { f: &'a F, panic: Mutex>, } unsafe extern "C" fn trampoline( x: f64, y: f64, z: f64, ctx: *mut std::ffi::c_void, ) -> f64 where F: Fn(f64, f64, f64) -> f64 + Sync, { // Catch panics to prevent UB from unwinding through C stack frames. let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { // SAFETY: ctx points to a Context with an F that is Sync, so // shared access from multiple C threads is sound. let ctx = unsafe { &*(ctx as *const Context<'_, F>) }; (ctx.f)(x, y, z) })); match result { Ok(distance) => distance, Err(payload) => { // Return large positive distance to avoid UB from // unwinding through C, then resume after the FFI call. // SAFETY: ctx points to a Context that remains valid for // the duration of the manifold_level_set call. let ctx = unsafe { &*(ctx as *const Context<'_, F>) }; store_panic(&ctx.panic, payload); f64::MAX } } } let ctx = Context { f: &f, panic: Mutex::new(None), }; let ctx_ptr = &ctx as *const Context<'_, F> as *mut std::ffi::c_void; // SAFETY: manifold_alloc_box returns a valid handle. let box_ptr = unsafe { manifold_alloc_box() }; // SAFETY: box_ptr is valid from alloc. unsafe { manifold_box( box_ptr, bounds.0[0], bounds.0[1], bounds.0[2], bounds.1[0], bounds.1[1], bounds.1[2], ); } // SAFETY: manifold_alloc_manifold returns a valid handle. } ``` -------------------------------- ### Get Maximum Corner Source: https://docs.rs/manifold-csg/latest/manifold_csg/bounding_box/struct.BoundingBox.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the maximum corner coordinates [x, y, z] of the bounding box. ```rust pub fn max(&self) -> [f64; 3] ``` -------------------------------- ### CloneToUninit Implementation for T Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.Rect2.html?search=std%3A%3Avec Provides the unsafe clone_to_uninit method for performing copy-assignment to uninitialized memory. This is a nightly-only experimental API. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### Get Minimum Corner Source: https://docs.rs/manifold-csg/latest/manifold_csg/bounding_box/struct.BoundingBox.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the minimum corner coordinates [x, y, z] of the bounding box. ```rust pub fn min(&self) -> [f64; 3] ``` -------------------------------- ### pub fn from_sdf_seq_with_context( ctx: &ExecutionContext, f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ) -> Self where F: FnMut(f64, f64, f64) -> f64 Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=std%3A%3Avec Sequential construction of a manifold from an SDF with context support for progress and cancellation. Combines sequential evaluation with execution context. ```APIDOC ## pub fn from_sdf_seq_with_context( ctx: &ExecutionContext, f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ) -> Self where F: FnMut(f64, f64, f64) -> f64 ### Description Sequential construction of a manifold from an SDF with context support for progress and cancellation. Combines sequential evaluation with execution context. ### Method `from_sdf_seq_with_context` ### Parameters * `ctx` (*ExecutionContext) - The execution context for progress and cancellation. * `f` (FnMut(f64, f64, f64) -> f64) - The signed distance function closure. * `bounds` (([f64; 3], [f64; 3])) - The bounding box for the SDF evaluation. * `edge_length` (f64) - The approximate edge length of the output mesh. * `level` (f64) - The isosurface level (typically 0.0). * `tolerance` (f64) - The tolerance for surface accuracy. ``` -------------------------------- ### Get Tolerance Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the tolerance used for merging and vertex welding. This value affects geometric precision. ```rust pub fn tolerance(&self) -> f64 { // SAFETY: self.ptr is valid (invariant). unsafe { manifold_meshgl64_tolerance(self.ptr) } } ``` -------------------------------- ### Create and Manipulate CrossSection Source: https://docs.rs/manifold-csg/latest/manifold_csg/cross_section/struct.CrossSection.html?search=std%3A%3Avec Demonstrates creating a square cross-section, offsetting it, and extruding it into a 3D manifold. Requires importing Manifold, CrossSection, and JoinType. ```rust use manifold_csg::{Manifold, CrossSection, JoinType}; let section = CrossSection::square(10.0, 10.0, true); let expanded = section.offset(2.0, JoinType::Round, 2.0, 16); let solid = Manifold::extrude(&expanded, 20.0); ``` -------------------------------- ### Get Number of Vertices Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/mesh.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the number of vertices in a MeshGL object. Assumes the internal pointer is valid. ```rust pub fn num_vert(&self) -> usize { // SAFETY: self.ptr is valid (invariant). unsafe { manifold_meshgl_num_vert(self.ptr) } } ``` -------------------------------- ### impl Any for T Source: https://docs.rs/manifold-csg/latest/manifold_csg/manifold/struct.Manifold.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides the `type_id` method to get the `TypeId` of an object. This is a blanket implementation for any type `T` that is `'static + ?Sized`. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Returns - `TypeId`: The unique identifier for the type of `self`. ``` -------------------------------- ### SDF Implementation Helper Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/manifold.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Internal implementation for constructing manifolds from SDFs, handling both context-aware and non-context scenarios. It includes a trampoline for FFI calls and panic handling. ```rust fn from_sdf_impl( f: F, bounds: ([f64; 3], [f64; 3]), edge_length: f64, level: f64, tolerance: f64, ec: *mut ManifoldExecutionContext, ) -> Self where F: Fn(f64, f64, f64) -> f64 + Sync, { struct Context<'a, F> { f: &'a F, panic: Mutex>, } unsafe extern "C" fn trampoline( x: f64, y: f64, z: f64, ctx: *mut std::ffi::c_void, ) -> f64 where F: Fn(f64, f64, f64) -> f64 + Sync, { // Catch panics to prevent UB from unwinding through C stack frames. let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { // SAFETY: ctx points to a Context with an F that is Sync, so // shared access from multiple C threads is sound. let ctx = unsafe { &*(ctx as *const Context<'_, F>) }; (ctx.f)(x, y, z) })); match result { Ok(distance) => distance, Err(payload) => { // Return large positive distance to avoid UB from // unwinding through C, then resume after the FFI call. // SAFETY: ctx points to a Context that remains valid for // the duration of the manifold_level_set call. let ctx = unsafe { &*(ctx as *const Context<'_, F>) }; store_panic(&ctx.panic, payload); f64::MAX } } } let ctx = Context { f: &f, panic: Mutex::new(None), }; let ctx_ptr = &ctx as *const Context<'_, F> as *mut std::ffi::c_void; // SAFETY: manifold_alloc_box returns a valid handle. let box_ptr = unsafe { manifold_alloc_box() }; // SAFETY: box_ptr is valid from alloc. unsafe { manifold_box( box_ptr, bounds.0[0], bounds.0[1], bounds.0[2], bounds.1[0], bounds.1[1], bounds.1[2], ); } // SAFETY: manifold_alloc_manifold returns a valid handle. } ``` -------------------------------- ### Get Number of Vertices in Rust Source: https://docs.rs/manifold-csg/latest/src/manifold_csg/cross_section.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the number of vertices in a cross-section. Assumes the internal pointer is valid. ```rust /// Number of vertices. #[must_use] pub fn num_vert(&self) -> usize { // SAFETY: self.ptr is valid (invariant). unsafe { manifold_cross_section_num_vert(self.ptr) } } ```