pub struct PcbPlacementEngine { /* private fields */ }Expand description
PCB placement engine for managing component placement.
Implementations§
Source§impl PcbPlacementEngine
impl PcbPlacementEngine
Sourcepub fn set_grid_mm(&mut self, spacing_mm: f64)
pub fn set_grid_mm(&mut self, spacing_mm: f64)
Set the grid from a spacing value in mm.
Sourcepub fn set_board_bounds(&mut self, bounds: CoordRect)
pub fn set_board_bounds(&mut self, bounds: CoordRect)
Set board bounds for edge alignment.
Sourcepub fn calculate_board_bounds(&mut self, pcb: &PcbDoc)
pub fn calculate_board_bounds(&mut self, pcb: &PcbDoc)
Calculate board bounds from the document.
Sourcepub fn snap_to_grid(&self, point: CoordPoint) -> CoordPoint
pub fn snap_to_grid(&self, point: CoordPoint) -> CoordPoint
Snap a point to the grid.
Sourcepub fn get_component_position(
&self,
pcb: &PcbDoc,
designator: &str,
) -> Option<ComponentPosition>
pub fn get_component_position( &self, pcb: &PcbDoc, designator: &str, ) -> Option<ComponentPosition>
Get the position of a component.
Sourcepub fn resolve_anchor(
&self,
pcb: &PcbDoc,
anchor: &PlacementAnchor,
current_pos: Option<&ComponentPosition>,
) -> Result<CoordPoint, String>
pub fn resolve_anchor( &self, pcb: &PcbDoc, anchor: &PlacementAnchor, current_pos: Option<&ComponentPosition>, ) -> Result<CoordPoint, String>
Resolve a placement anchor to an absolute position.
Sourcepub fn find_connected_routes(
&self,
pcb: &PcbDoc,
designator: &str,
) -> ConnectedRoutes
pub fn find_connected_routes( &self, pcb: &PcbDoc, designator: &str, ) -> ConnectedRoutes
Check if a component has connected routes (tracks/vias touching its pads).
Sourcepub fn list_components(&self, pcb: &PcbDoc) -> Vec<(String, ComponentPosition)>
pub fn list_components(&self, pcb: &PcbDoc) -> Vec<(String, ComponentPosition)>
List all components with their positions.
Sourcepub fn find_component<'a>(
&self,
pcb: &'a PcbDoc,
designator: &str,
) -> Option<&'a PcbDocComponent>
pub fn find_component<'a>( &self, pcb: &'a PcbDoc, designator: &str, ) -> Option<&'a PcbDocComponent>
Find a component by designator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PcbPlacementEngine
impl RefUnwindSafe for PcbPlacementEngine
impl Send for PcbPlacementEngine
impl Sync for PcbPlacementEngine
impl Unpin for PcbPlacementEngine
impl UnwindSafe for PcbPlacementEngine
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> 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>
Converts
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>
Converts
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