Struct observation_tools_client::artifacts::MeshBuilder
source · pub struct MeshBuilder { /* private fields */ }
Expand description
A 3D mesh
§Example
use observation_tools_client::artifacts::MeshBuilder;
use observation_tools_client::artifacts::Transform3Builder;
use observation_tools_client::artifacts::VertexBuilder;
#[tokio::main]
async fn main() -> Result<(), observation_tools_client::ClientError> {
tracing_subscriber::fmt::init();
let client = observation_tools_client::test_utils::create_doc_test_client()?;
// Set up a 3D group:
let run = client.create_run("create_mesh3")?;
let group3d = run.child_uploader_3d("mesh3_world")?;
// Basic usage:
let mut mesh = MeshBuilder::new();
mesh.add_vertex(VertexBuilder::new((0.0, 0.0, 0.0)));
mesh.add_vertex(VertexBuilder::new((1.0, 0.0, 0.0)));
mesh.add_vertex(VertexBuilder::new((0.0, 1.0, 0.0)));
mesh.add_triangle(0, 1, 2);
group3d.create_object3("my_mesh", mesh)?;
client.shutdown().await?;
Ok(())
}
Implementations§
source§impl MeshBuilder
impl MeshBuilder
pub fn new() -> MeshBuilder
pub fn add_vertex(&mut self, vertex: VertexBuilder)
pub fn add_triangle(&mut self, i0: u32, i1: u32, i2: u32)
Trait Implementations§
source§impl Clone for MeshBuilder
impl Clone for MeshBuilder
source§fn clone(&self) -> MeshBuilder
fn clone(&self) -> MeshBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl From<MeshBuilder> for JsValue
impl From<MeshBuilder> for JsValue
source§fn from(value: MeshBuilder) -> Self
fn from(value: MeshBuilder) -> Self
Converts to this type from the input type.
source§impl FromWasmAbi for MeshBuilder
impl FromWasmAbi for MeshBuilder
source§impl Into<Geometry3Builder> for MeshBuilder
impl Into<Geometry3Builder> for MeshBuilder
source§fn into(self) -> Geometry3Builder
fn into(self) -> Geometry3Builder
Converts this type into the (usually inferred) input type.
source§impl Into<Object3Builder> for MeshBuilder
impl Into<Object3Builder> for MeshBuilder
source§fn into(self) -> Object3Builder
fn into(self) -> Object3Builder
Converts this type into the (usually inferred) input type.
source§impl IntoWasmAbi for MeshBuilder
impl IntoWasmAbi for MeshBuilder
source§impl LongRefFromWasmAbi for MeshBuilder
impl LongRefFromWasmAbi for MeshBuilder
source§impl OptionFromWasmAbi for MeshBuilder
impl OptionFromWasmAbi for MeshBuilder
source§impl OptionIntoWasmAbi for MeshBuilder
impl OptionIntoWasmAbi for MeshBuilder
source§impl RefFromWasmAbi for MeshBuilder
impl RefFromWasmAbi for MeshBuilder
§type Anchor = Ref<'static, MeshBuilder>
type Anchor = Ref<'static, MeshBuilder>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.source§impl RefMutFromWasmAbi for MeshBuilder
impl RefMutFromWasmAbi for MeshBuilder
source§impl TryFromJsValue for MeshBuilder
impl TryFromJsValue for MeshBuilder
source§impl VectorFromWasmAbi for MeshBuilder
impl VectorFromWasmAbi for MeshBuilder
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[MeshBuilder]>
source§impl VectorIntoWasmAbi for MeshBuilder
impl VectorIntoWasmAbi for MeshBuilder
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[MeshBuilder]>) -> Self::Abi
source§impl WasmDescribeVector for MeshBuilder
impl WasmDescribeVector for MeshBuilder
Auto Trait Implementations§
impl RefUnwindSafe for MeshBuilder
impl Send for MeshBuilder
impl Sync for MeshBuilder
impl Unpin for MeshBuilder
impl UnwindSafe for MeshBuilder
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
Mutably borrows from an owned value. Read more
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>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.