pub struct SurfaceMeshHandle { /* private fields */ }Expand description
Handle for a registered surface mesh.
This handle provides methods to add quantities and configure the
appearance of a surface mesh. Methods return &Self to allow chaining.
§Example
use polyscope_rs::*;
init().unwrap();
let vertices = vec![Vec3::ZERO, Vec3::X, Vec3::Y];
let faces = vec![[0u32, 1, 2]];
let mesh = register_surface_mesh("mesh", vertices, faces);
mesh.set_surface_color(Vec3::new(1.0, 0.5, 0.0))
.set_show_edges(true)
.add_vertex_scalar_quantity("height", vec![0.0, 1.0, 0.5]);Implementations§
Source§impl SurfaceMeshHandle
impl SurfaceMeshHandle
Sourcepub fn set_surface_color(&self, color: Vec3) -> &Self
pub fn set_surface_color(&self, color: Vec3) -> &Self
Sets the surface color.
Sourcepub fn set_edge_color(&self, color: Vec3) -> &Self
pub fn set_edge_color(&self, color: Vec3) -> &Self
Sets the edge color.
Sourcepub fn set_edge_width(&self, width: f32) -> &Self
pub fn set_edge_width(&self, width: f32) -> &Self
Sets the edge width.
Sourcepub fn set_show_edges(&self, show: bool) -> &Self
pub fn set_show_edges(&self, show: bool) -> &Self
Sets whether edges are shown.
Sourcepub fn set_backface_color(&self, color: Vec3) -> &Self
pub fn set_backface_color(&self, color: Vec3) -> &Self
Sets the backface color.
Sourcepub fn set_transparency(&self, transparency: f32) -> &Self
pub fn set_transparency(&self, transparency: f32) -> &Self
Sets the transparency (0.0 = opaque, 1.0 = fully transparent).
Sourcepub fn set_material(&self, material: &str) -> &Self
pub fn set_material(&self, material: &str) -> &Self
Sets the material.
Sourcepub fn add_vertex_scalar_quantity(&self, name: &str, values: Vec<f32>) -> &Self
pub fn add_vertex_scalar_quantity(&self, name: &str, values: Vec<f32>) -> &Self
Adds a vertex scalar quantity.
Sourcepub fn add_face_scalar_quantity(&self, name: &str, values: Vec<f32>) -> &Self
pub fn add_face_scalar_quantity(&self, name: &str, values: Vec<f32>) -> &Self
Adds a face scalar quantity.
Sourcepub fn add_vertex_color_quantity(&self, name: &str, colors: Vec<Vec3>) -> &Self
pub fn add_vertex_color_quantity(&self, name: &str, colors: Vec<Vec3>) -> &Self
Adds a vertex color quantity (RGB, alpha defaults to 1.0).
Sourcepub fn add_vertex_color_quantity_with_alpha(
&self,
name: &str,
colors: Vec<Vec4>,
) -> &Self
pub fn add_vertex_color_quantity_with_alpha( &self, name: &str, colors: Vec<Vec4>, ) -> &Self
Adds a vertex color quantity with explicit per-vertex RGBA alpha values.
Use this to specify per-vertex transparency. Requires Pretty (depth peeling) transparency mode to render correctly (set via appearance settings).
Sourcepub fn add_face_color_quantity(&self, name: &str, colors: Vec<Vec3>) -> &Self
pub fn add_face_color_quantity(&self, name: &str, colors: Vec<Vec3>) -> &Self
Adds a face color quantity (RGB, alpha defaults to 1.0).
Sourcepub fn add_face_color_quantity_with_alpha(
&self,
name: &str,
colors: Vec<Vec4>,
) -> &Self
pub fn add_face_color_quantity_with_alpha( &self, name: &str, colors: Vec<Vec4>, ) -> &Self
Adds a face color quantity with explicit per-face RGBA alpha values.
Use this to specify per-face transparency. Requires Pretty (depth peeling) transparency mode to render correctly (set via appearance settings).
Sourcepub fn add_vertex_vector_quantity(
&self,
name: &str,
vectors: Vec<Vec3>,
) -> &Self
pub fn add_vertex_vector_quantity( &self, name: &str, vectors: Vec<Vec3>, ) -> &Self
Adds a vertex vector quantity (auto-scaled).
Sourcepub fn add_face_vector_quantity(&self, name: &str, vectors: Vec<Vec3>) -> &Self
pub fn add_face_vector_quantity(&self, name: &str, vectors: Vec<Vec3>) -> &Self
Adds a face vector quantity (auto-scaled).
Sourcepub fn add_vertex_parameterization_quantity(
&self,
name: &str,
coords: Vec<Vec2>,
) -> &Self
pub fn add_vertex_parameterization_quantity( &self, name: &str, coords: Vec<Vec2>, ) -> &Self
Adds a vertex parameterization (UV) quantity.
Sourcepub fn add_corner_parameterization_quantity(
&self,
name: &str,
coords: Vec<Vec2>,
) -> &Self
pub fn add_corner_parameterization_quantity( &self, name: &str, coords: Vec<Vec2>, ) -> &Self
Adds a corner parameterization (UV) quantity.
Sourcepub fn add_vertex_intrinsic_vector_quantity(
&self,
name: &str,
vectors: Vec<Vec2>,
basis_x: Vec<Vec3>,
basis_y: Vec<Vec3>,
) -> &Self
pub fn add_vertex_intrinsic_vector_quantity( &self, name: &str, vectors: Vec<Vec2>, basis_x: Vec<Vec3>, basis_y: Vec<Vec3>, ) -> &Self
Adds a vertex intrinsic vector quantity with explicit tangent basis (auto-scaled).
Sourcepub fn add_vertex_intrinsic_vector_quantity_auto(
&self,
name: &str,
vectors: Vec<Vec2>,
) -> &Self
pub fn add_vertex_intrinsic_vector_quantity_auto( &self, name: &str, vectors: Vec<Vec2>, ) -> &Self
Adds a vertex intrinsic vector quantity with auto-computed tangent basis.
Sourcepub fn add_face_intrinsic_vector_quantity(
&self,
name: &str,
vectors: Vec<Vec2>,
basis_x: Vec<Vec3>,
basis_y: Vec<Vec3>,
) -> &Self
pub fn add_face_intrinsic_vector_quantity( &self, name: &str, vectors: Vec<Vec2>, basis_x: Vec<Vec3>, basis_y: Vec<Vec3>, ) -> &Self
Adds a face intrinsic vector quantity with explicit tangent basis (auto-scaled).
Sourcepub fn add_face_intrinsic_vector_quantity_auto(
&self,
name: &str,
vectors: Vec<Vec2>,
) -> &Self
pub fn add_face_intrinsic_vector_quantity_auto( &self, name: &str, vectors: Vec<Vec2>, ) -> &Self
Adds a face intrinsic vector quantity with auto-computed tangent basis.
Trait Implementations§
Source§impl Clone for SurfaceMeshHandle
impl Clone for SurfaceMeshHandle
Source§fn clone(&self) -> SurfaceMeshHandle
fn clone(&self) -> SurfaceMeshHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SurfaceMeshHandle
impl RefUnwindSafe for SurfaceMeshHandle
impl Send for SurfaceMeshHandle
impl Sync for SurfaceMeshHandle
impl Unpin for SurfaceMeshHandle
impl UnsafeUnpin for SurfaceMeshHandle
impl UnwindSafe for SurfaceMeshHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more