Skip to main content

RasterizedModel

Struct RasterizedModel 

Source
pub struct RasterizedModel<S: Scalar> {
    pub vertices: HashMap<VertexId, Vector3<S>>,
    pub edges: HashMap<EdgeId, Vec<Vector3<S>>>,
    pub faces: HashMap<FaceId, Vec<TriangleFace<S>>>,
}
Expand description

A Model rasterized once, with every sampled point/polyline/triangle kept alongside the id of the entity it came from.

This is the single place the crate turns topology into sampled geometry — PrimitiveScene rendering (rasterize_model) and ray picking (geop_cad_base::pick) both build on top of it, rather than each walking Model and sampling curves/surfaces on their own. That matters beyond not repeating code: it guarantees a pick can never disagree with what the viewer actually drew, because both read the same triangles.

Fields§

§vertices: HashMap<VertexId, Vector3<S>>§edges: HashMap<EdgeId, Vec<Vector3<S>>>

Each edge’s curve sampled into an n-point polyline.

§faces: HashMap<FaceId, Vec<TriangleFace<S>>>

Each face’s trimmed region, triangulated (see face_triangles_uv) and mapped through surface.evaluate — one face generally maps to several triangles.

Auto Trait Implementations§

§

impl<S> Freeze for RasterizedModel<S>

§

impl<S> RefUnwindSafe for RasterizedModel<S>
where S: RefUnwindSafe,

§

impl<S> Send for RasterizedModel<S>

§

impl<S> Sync for RasterizedModel<S>

§

impl<S> Unpin for RasterizedModel<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for RasterizedModel<S>

§

impl<S> UnwindSafe for RasterizedModel<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.