Trait fj_kernel::builder::CycleBuilder
source · pub trait CycleBuilder {
fn update_as_polygon_from_points(
&mut self,
surface: impl Into<Partial<Surface>>,
points: impl IntoIterator<Item = impl Into<Point<2>>>
) -> Vec<Partial<HalfEdge>>;
fn update_as_polygon(&mut self);
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>;
}Expand description
Builder API for PartialCycle
Required Methods§
sourcefn update_as_polygon_from_points(
&mut self,
surface: impl Into<Partial<Surface>>,
points: impl IntoIterator<Item = impl Into<Point<2>>>
) -> Vec<Partial<HalfEdge>>
fn update_as_polygon_from_points(
&mut self,
surface: impl Into<Partial<Surface>>,
points: impl IntoIterator<Item = impl Into<Point<2>>>
) -> Vec<Partial<HalfEdge>>
Create a cycle as a polygonal chain from the provided points
sourcefn update_as_polygon(&mut self)
fn update_as_polygon(&mut self)
Update cycle to be a polygon
Will update each half-edge in the cycle to be a line segment.
sourcefn add_half_edge(&mut self) -> Partial<HalfEdge>
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.
sourcefn add_half_edge_from_point_to_start(
&mut self,
point: impl Into<Point<2>>
) -> Partial<HalfEdge>
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.