pub trait CycleBuilder {
    // Required methods
    fn add_half_edge(&mut self) -> Partial<HalfEdge>;
    fn add_half_edge_from_point_to_start(
        &mut self,
        point: impl Into<Point<2>>
    ) -> Partial<HalfEdge>;
    fn add_half_edge_from_global_point_to_start(
        &mut self,
        point: impl Into<Point<3>>
    ) -> Partial<HalfEdge>;
    fn update_as_polygon_from_points<O, P>(
        &mut self,
        points: O
    ) -> O::SameSize<Partial<HalfEdge>>
       where O: ObjectArgument<P>,
             P: Into<Point<2>>;
    fn update_as_polygon(&mut self);
    fn update_as_triangle_from_global_points(
        &mut self,
        points: [impl Into<Point<3>>; 3]
    ) -> [Partial<HalfEdge>; 3];
    fn connect_to_open_edges<O>(
        &mut self,
        edges: O
    ) -> O::SizePlusOne<Partial<HalfEdge>>
       where O: ObjectArgument<Partial<HalfEdge>>;
    fn connect_to_closed_edges<O>(
        &mut self,
        edges: O
    ) -> O::SameSize<Partial<HalfEdge>>
       where O: ObjectArgument<Partial<HalfEdge>>;
}
Expand description

Builder API for PartialCycle

Required Methods§

source

fn add_half_edge(&mut self) -> Partial<HalfEdge>

Add a new half-edge to the cycle

Creates a half-edge and adds it to the cycle. The new half-edge is connected to the front vertex of the last half-edge , and the back vertex of the first edge, making sure the half-edges actually form a cycle.

If this is the first half-edge being added, it is connected to itself, meaning its front and back vertices are the same.

source

fn add_half_edge_from_point_to_start( &mut self, point: impl Into<Point<2>> ) -> Partial<HalfEdge>

Add a new half-edge that starts at the provided point

Opens the cycle between the last and first edge, updates the last edge to go the provided point, and adds a new half-edge from the provided point the the first edge.

If the cycle doesn’t have any edges yet, the new edge connects to itself, starting and ending at the provided point.

source

fn add_half_edge_from_global_point_to_start( &mut self, point: impl Into<Point<3>> ) -> Partial<HalfEdge>

Add a new half-edge that starts at the provided point

Opens the cycle between the last and first edge, updates the last edge to go the provided point, and adds a new half-edge from the provided point the the first edge.

If the cycle doesn’t have any edges yet, the new edge connects to itself, starting and ending at the provided point.

source

fn update_as_polygon_from_points<O, P>( &mut self, points: O ) -> O::SameSize<Partial<HalfEdge>>where O: ObjectArgument<P>, P: Into<Point<2>>,

Update cycle as a polygon from the provided points

source

fn update_as_polygon(&mut self)

Update cycle as a polygon

Will update each half-edge in the cycle to be a line segment.

source

fn update_as_triangle_from_global_points( &mut self, points: [impl Into<Point<3>>; 3] ) -> [Partial<HalfEdge>; 3]

Update cycle as a triangle, from global (3D) points

Uses the three points to infer a plane that is used as the surface.

Implementation Note

This method is probably just temporary, and will be generalized into a “update as polygon from global points” method sooner or later. For now, I didn’t want to deal with the question of how to infer the surface, and how to handle points that don’t fit that surface.

source

fn connect_to_open_edges<O>( &mut self, edges: O ) -> O::SizePlusOne<Partial<HalfEdge>>where O: ObjectArgument<Partial<HalfEdge>>,

Connect the cycle to the provided half-edges

Assumes that the provided half-edges, once translated into local equivalents of this cycle, will not form a cycle themselves.

Returns the local equivalents of the provided half-edges and, as the last entry, an additional half-edge that closes the cycle.

source

fn connect_to_closed_edges<O>( &mut self, edges: O ) -> O::SameSize<Partial<HalfEdge>>where O: ObjectArgument<Partial<HalfEdge>>,

Connect the cycles to the provided half-edges

Assumes that the provided half-edges, once translated into local equivalents of this cycle, form a cycle themselves.

Returns the local equivalents of the provided half-edges.

Implementors§