pub trait OutlineMeshExt: Sized {
// Required methods
fn generate_outline_normals(
&mut self,
settings: &GenerateOutlineNormalsSettings,
) -> Result<(), GenerateOutlineNormalsError>;
fn with_generated_outline_normals(
self,
settings: &GenerateOutlineNormalsSettings,
) -> Result<Self, GenerateOutlineNormalsError>;
}
Expand description
Extension methods for Mesh
.
Required Methods§
Sourcefn generate_outline_normals(
&mut self,
settings: &GenerateOutlineNormalsSettings,
) -> Result<(), GenerateOutlineNormalsError>
fn generate_outline_normals( &mut self, settings: &GenerateOutlineNormalsSettings, ) -> Result<(), GenerateOutlineNormalsError>
Generates outline normals for the mesh.
Vertex extrusion only works for meshes with smooth surface normals. Hard edges cause visual artefacts. This function generates faux-smooth normals for outlining purposes by grouping vertices by their position and averaging the normals at each point. These outline normals are then inserted as a separate vertex attribute so that the regular normals remain untouched. However, insofar as the outline normals are not perpendicular to the surface of the mesh, this technique may result in non-uniform outline thickness.
This function only supports meshes with TriangleList topology.
Sourcefn with_generated_outline_normals(
self,
settings: &GenerateOutlineNormalsSettings,
) -> Result<Self, GenerateOutlineNormalsError>
fn with_generated_outline_normals( self, settings: &GenerateOutlineNormalsSettings, ) -> Result<Self, GenerateOutlineNormalsError>
Chainable version of generate_outline_normals
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.