Overview of truck-polymesh
mastertruck-polymesh crate provides polyline-polygon data structures and various algorithms for handling meshes within the Truck CAD kernel ecosystem.repository·master·Indexed 23 days ago
https://github.com/ricosjp/truckAn open-source CAD kernel written in Rust focusing on B-rep with NURBS. It utilizes WebGPU for high performance and safety, providing a modular system of crates including truck-geometry for B-splines and NURBS, truck-topology for solids and shells, truck-modeling for integrated algorithms, and truck-js for JavaScript/WASM integration.
truck-polymesh crate provides polyline-polygon data structures and various algorithms for handling meshes within the Truck CAD kernel ecosystem.truck-rendimpl crate provides visualization capabilities for shapes and polygon meshes. It is designed to be platform-based, allowing for rendering of CAD data through various implementation modules.Truck is a modular CAD kernel composed of several specialized crates. Depending on your needs, you can use specific modules for geometry, topology, or modeling:
cgmath imports, curve/surface traits, tolerance).ParametricCurve and ParametricSurface.vertex, edge, wire, face, shell, and solid.Solid objects.wgpu.truck.truck-geometry crate provides core geometrical data structures for CAD operations. It specifically implements structures for representing curves and surfaces using knot vectors, B-splines, and NURBS (Non-Uniform Rational B-Splines).The truck-shapeops crate provides advanced geometric operations for the Truck CAD kernel. Its primary functions include:
AND, OR, NOT) on Solid objects.truck-base crate provides the fundamental building blocks for the Truck CAD kernel. It contains essential basic structs and traits required for geometric modeling, including imports for cgmath, definitions for curve and surface traits, and tolerance management.wgsl-utils module is a utility library for the WebGPU Shading Language (WGSL). Note that this module is a standalone utility and is NOT part of the truck-platform package.truck-modeling crate provides integrated modeling algorithms based on geometry and topology. It is designed to facilitate the creation of complex 3D shapes using various modeling techniques.The truck-geotrait crate provides a set of core geometric traits that define how different geometric entities behave. These traits allow for polymorphic handling of various geometric types. Key traits include:
ParametricCurve: Defines behavior for curves that can be evaluated at a parameter value.ParametricSurface: Defines behavior for surfaces that can be evaluated at two parameters.By implementing or using these traits, you can write generic geometric algorithms that work across different underlying implementations of curves and surfaces.
truck-js package provides a JavaScript wrapper for the Truck CAD kernel. It allows developers to interact with Truck's capabilities within a JavaScript environment.In the material-samples demonstration, material properties are visualized as follows:
Note: A model that is both far to the right and low will appear black because it lacks light diffusion and has no roughness in the microfacet model.
truck-topology crate provides the fundamental topological structures used to represent geometric entities in the Truck CAD kernel. These structs define the hierarchy of a geometric model, ranging from individual points to complex volumes.