diff --git a/src/autorouter/autorouter.rs b/src/autorouter/autorouter.rs index fec2c5a..a9fd35f 100644 --- a/src/autorouter/autorouter.rs +++ b/src/autorouter/autorouter.rs @@ -103,7 +103,7 @@ impl Autorouter { .node_index() { RatvertexIndex::FixedDot(dot) => dot, - RatvertexIndex::Zone(zone) => self.board.zone_apex(zone), + RatvertexIndex::Poly(poly) => self.board.poly_apex(poly), }; let target_dot = match self @@ -114,7 +114,7 @@ impl Autorouter { .node_index() { RatvertexIndex::FixedDot(dot) => dot, - RatvertexIndex::Zone(zone) => self.board.zone_apex(zone), + RatvertexIndex::Poly(poly) => self.board.poly_apex(poly), }; (source_dot, target_dot) diff --git a/src/autorouter/ratsnest.rs b/src/autorouter/ratsnest.rs index 5bf9899..5fd7727 100644 --- a/src/autorouter/ratsnest.rs +++ b/src/autorouter/ratsnest.rs @@ -21,7 +21,7 @@ use crate::{ geometry::{compound::ManageCompounds, shape::AccessShape}, graph::{GenericIndex, GetPetgraphIndex}, layout::{ - zone::{MakePolyShape, ZoneWeight}, + poly::{MakePolyShape, PolyWeight}, Layout, }, triangulation::{GetTrianvertexNodeIndex, Triangulation}, @@ -31,14 +31,14 @@ use crate::{ #[derive(Debug, Clone, Copy, PartialEq)] pub enum RatvertexIndex { FixedDot(FixedDotIndex), - Zone(GenericIndex), + Poly(GenericIndex), } impl From for crate::layout::NodeIndex { fn from(vertex: RatvertexIndex) -> crate::layout::NodeIndex { match vertex { RatvertexIndex::FixedDot(dot) => crate::layout::NodeIndex::Primitive(dot.into()), - RatvertexIndex::Zone(zone) => crate::layout::NodeIndex::Compound(zone.into()), + RatvertexIndex::Poly(poly) => crate::layout::NodeIndex::Compound(poly.into()), } } } @@ -89,7 +89,7 @@ impl Ratsnest { for node in layout.drawing().layer_primitive_nodes(layer) { match node { PrimitiveIndex::FixedDot(dot) => { - if layout.zones(dot).next().is_none() { + if layout.polys(dot).next().is_none() { if let Some(net) = layout.drawing().primitive(dot).maybe_net() { if !triangulations.contains_key(&(layer, net)) { triangulations.insert( @@ -113,8 +113,8 @@ impl Ratsnest { } } - for zone in layout.layer_zone_nodes(layer) { - if let Some(net) = layout.drawing().compound_weight(zone.into()).maybe_net() { + for poly in layout.layer_poly_nodes(layer) { + if let Some(net) = layout.drawing().compound_weight(poly.into()).maybe_net() { if !triangulations.contains_key(&(layer, net)) { triangulations.insert( (layer, net), @@ -126,8 +126,8 @@ impl Ratsnest { .get_mut(&(layer, net)) .unwrap() .add_vertex(RatvertexWeight { - vertex: RatvertexIndex::Zone(zone), - pos: layout.zone(zone).shape().center(), + vertex: RatvertexIndex::Poly(poly), + pos: layout.poly(poly).shape().center(), })? } } diff --git a/src/autorouter/selection.rs b/src/autorouter/selection.rs index bae8040..971eda9 100644 --- a/src/autorouter/selection.rs +++ b/src/autorouter/selection.rs @@ -7,7 +7,7 @@ use crate::{ drawing::graph::{GetLayer, MakePrimitive}, geometry::compound::ManageCompounds, graph::{GenericIndex, GetPetgraphIndex}, - layout::{zone::ZoneWeight, CompoundWeight, NodeIndex}, + layout::{poly::PolyWeight, CompoundWeight, NodeIndex}, }; #[derive(Debug, Clone, Hash, Eq, PartialEq, Serialize, Deserialize)] @@ -66,11 +66,11 @@ impl Selection { primitive.primitive(board.layout().drawing()).layer() } NodeIndex::Compound(compound) => { - if let CompoundWeight::Zone(..) = board.layout().drawing().compound_weight(compound) + if let CompoundWeight::Poly(..) = board.layout().drawing().compound_weight(compound) { board .layout() - .zone(GenericIndex::::new(compound.petgraph_index())) + .poly(GenericIndex::::new(compound.petgraph_index())) .layer() } else { unreachable!() diff --git a/src/bin/topola-egui/app.rs b/src/bin/topola-egui/app.rs index 0dc40d1..6ccc4a6 100644 --- a/src/bin/topola-egui/app.rs +++ b/src/bin/topola-egui/app.rs @@ -29,7 +29,7 @@ use topola::{ shape::AccessShape, GenericNode, }, - layout::{via::ViaWeight, zone::MakePolyShape, Layout}, + layout::{poly::MakePolyShape, via::ViaWeight, Layout}, math::Circle, router::{ draw::DrawException, diff --git a/src/bin/topola-egui/overlay.rs b/src/bin/topola-egui/overlay.rs index cedc5ce..531b890 100644 --- a/src/bin/topola-egui/overlay.rs +++ b/src/bin/topola-egui/overlay.rs @@ -17,8 +17,8 @@ use topola::{ }, graph::{GenericIndex, GetPetgraphIndex}, layout::{ + poly::{MakePolyShape, Poly, PolyWeight}, via::ViaWeight, - zone::{MakePolyShape, Zone, ZoneWeight}, CompoundWeight, Layout, NodeIndex, }, }; @@ -76,9 +76,9 @@ impl Overlay { } NodeIndex::Compound(compound) => { match board.layout().drawing().compound_weight(compound) { - CompoundWeight::Zone(weight) => board + CompoundWeight::Poly(weight) => board .layout() - .zone(GenericIndex::::new(compound.petgraph_index())) + .poly(GenericIndex::::new(compound.petgraph_index())) .shape() .into(), CompoundWeight::Via(weight) => board diff --git a/src/bin/topola-egui/viewport.rs b/src/bin/topola-egui/viewport.rs index 9ecba75..9d699cc 100644 --- a/src/bin/topola-egui/viewport.rs +++ b/src/bin/topola-egui/viewport.rs @@ -14,7 +14,7 @@ use topola::{ primitive::MakePrimitiveShape, }, geometry::{shape::AccessShape, GenericNode}, - layout::{via::ViaWeight, zone::MakePolyShape}, + layout::{poly::MakePolyShape, via::ViaWeight}, math::Circle, specctra::mesadata::SpecctraMesadata, }; @@ -126,17 +126,17 @@ impl Viewport { painter.paint_primitive(&shape, color); } - for zone in board.layout().layer_zone_nodes(i) { + for poly in board.layout().layer_poly_nodes(i) { let color = if overlay .selection() - .contains_node(board, GenericNode::Compound(zone.into())) + .contains_node(board, GenericNode::Compound(poly.into())) { layers.highlight_colors[i] } else { layers.colors[i] }; - painter.paint_polygon(&board.layout().zone(zone).shape().polygon, color) + painter.paint_polygon(&board.layout().poly(poly).shape().polygon, color) } } } diff --git a/src/bin/topola-sdl2-demo/main.rs b/src/bin/topola-sdl2-demo/main.rs index d7c05e9..472579f 100644 --- a/src/bin/topola-sdl2-demo/main.rs +++ b/src/bin/topola-sdl2-demo/main.rs @@ -23,7 +23,7 @@ use topola::drawing::seg::FixedSegWeight; use topola::drawing::{Infringement, LayoutException}; use topola::geometry::primitive::{AccessPrimitiveShape, PrimitiveShape}; use topola::geometry::shape::AccessShape; -use topola::layout::zone::MakePolyShape; +use topola::layout::poly::MakePolyShape; use topola::layout::Layout; use topola::router::draw::DrawException; use topola::router::navmesh::Navmesh; @@ -303,9 +303,9 @@ fn render_times( painter.paint_primitive(&shape, color, view.zoom); } - for zone in layout.layer_zone_nodes(1) { + for poly in layout.layer_poly_nodes(1) { painter.paint_polygon( - &layout.zone(zone).shape().polygon, + &layout.poly(poly).shape().polygon, ColorU::new(52, 52, 200, 255), view.zoom, ); @@ -322,9 +322,9 @@ fn render_times( painter.paint_primitive(&shape, color, view.zoom); } - for zone in layout.layer_zone_nodes(0) { + for poly in layout.layer_poly_nodes(0) { painter.paint_polygon( - &layout.zone(zone).shape().polygon, + &layout.poly(poly).shape().polygon, ColorU::new(200, 52, 52, 255), view.zoom, ); diff --git a/src/board/board.rs b/src/board/board.rs index 6beb0a5..d9f6936 100644 --- a/src/board/board.rs +++ b/src/board/board.rs @@ -11,7 +11,7 @@ use crate::{ geometry::{shape::AccessShape, GenericNode}, graph::GenericIndex, layout::{ - zone::{GetMaybeApex, MakePolyShape, ZoneWeight}, + poly::{GetMaybeApex, MakePolyShape, PolyWeight}, Layout, NodeIndex, }, math::Circle, @@ -49,14 +49,14 @@ impl Board { dot } - pub fn add_zone_fixed_dot_infringably( + pub fn add_poly_fixed_dot_infringably( &mut self, weight: FixedDotWeight, - zone: GenericIndex, + poly: GenericIndex, ) -> FixedDotIndex { - let dot = self.layout.add_zone_fixed_dot_infringably(weight, zone); + let dot = self.layout.add_poly_fixed_dot_infringably(weight, poly); - if let Some(pin) = self.node_pinname(GenericNode::Compound(zone.into())) { + if let Some(pin) = self.node_pinname(GenericNode::Compound(poly.into())) { self.node_to_pinname .insert(GenericNode::Primitive(dot.into()), pin.to_string()); } @@ -81,18 +81,18 @@ impl Board { seg } - pub fn add_zone_fixed_seg_infringably( + pub fn add_poly_fixed_seg_infringably( &mut self, from: FixedDotIndex, to: FixedDotIndex, weight: FixedSegWeight, - zone: GenericIndex, + poly: GenericIndex, ) -> FixedSegIndex { let seg = self .layout - .add_zone_fixed_seg_infringably(from, to, weight, zone); + .add_poly_fixed_seg_infringably(from, to, weight, poly); - if let Some(pin) = self.node_pinname(GenericNode::Compound(zone.into())) { + if let Some(pin) = self.node_pinname(GenericNode::Compound(poly.into())) { self.node_to_pinname .insert(GenericNode::Primitive(seg.into()), pin.to_string()); } @@ -100,35 +100,35 @@ impl Board { seg } - pub fn add_zone( + pub fn add_poly( &mut self, - weight: ZoneWeight, + weight: PolyWeight, maybe_pin: Option, - ) -> GenericIndex { - let zone = self.layout.add_zone(weight); + ) -> GenericIndex { + let poly = self.layout.add_poly(weight); if let Some(pin) = maybe_pin { self.node_to_pinname - .insert(GenericNode::Compound(zone.into()), pin.to_string()); + .insert(GenericNode::Compound(poly.into()), pin.to_string()); } - zone + poly } - pub fn zone_apex(&mut self, zone: GenericIndex) -> FixedDotIndex { - if let Some(apex) = self.layout.zone(zone).maybe_apex() { + pub fn poly_apex(&mut self, poly: GenericIndex) -> FixedDotIndex { + if let Some(apex) = self.layout.poly(poly).maybe_apex() { apex } else { - self.add_zone_fixed_dot_infringably( + self.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { - pos: self.layout.zone(zone).shape().center(), + pos: self.layout.poly(poly).shape().center(), r: 100.0, }, - layer: self.layout.zone(zone).layer(), - maybe_net: self.layout.zone(zone).maybe_net(), + layer: self.layout.poly(poly).layer(), + maybe_net: self.layout.poly(poly).maybe_net(), }, - zone, + poly, ) } } diff --git a/src/layout/layout.rs b/src/layout/layout.rs index 85268ed..fe0b87b 100644 --- a/src/layout/layout.rs +++ b/src/layout/layout.rs @@ -25,15 +25,15 @@ use crate::{ }, graph::{GenericIndex, GetPetgraphIndex}, layout::{ + poly::{Poly, PolyWeight}, via::{Via, ViaWeight}, - zone::{Zone, ZoneWeight}, }, }; #[derive(Debug, Clone, Copy)] #[enum_dispatch(GetMaybeNet)] pub enum CompoundWeight { - Zone(ZoneWeight), + Poly(PolyWeight), Via(ViaWeight), } @@ -107,27 +107,27 @@ impl Layout { self.drawing.add_fixed_dot_infringably(weight) } - pub fn add_zone_fixed_dot( + pub fn add_poly_fixed_dot( &mut self, weight: FixedDotWeight, - zone: GenericIndex, + poly: GenericIndex, ) -> Result { let maybe_dot = self.drawing.add_fixed_dot(weight); if let Ok(dot) = maybe_dot { - self.drawing.add_to_compound(dot, zone.into()); + self.drawing.add_to_compound(dot, poly.into()); } maybe_dot } - pub fn add_zone_fixed_dot_infringably( + pub fn add_poly_fixed_dot_infringably( &mut self, weight: FixedDotWeight, - zone: GenericIndex, + poly: GenericIndex, ) -> FixedDotIndex { let dot = self.drawing.add_fixed_dot_infringably(weight); - self.drawing.add_to_compound(dot, zone.into()); + self.drawing.add_to_compound(dot, poly.into()); dot } @@ -149,31 +149,31 @@ impl Layout { self.drawing.add_fixed_seg_infringably(from, to, weight) } - pub fn add_zone_fixed_seg( + pub fn add_poly_fixed_seg( &mut self, from: FixedDotIndex, to: FixedDotIndex, weight: FixedSegWeight, - zone: GenericIndex, + poly: GenericIndex, ) -> Result { let maybe_seg = self.add_fixed_seg(from, to, weight); if let Ok(seg) = maybe_seg { - self.drawing.add_to_compound(seg, zone.into()); + self.drawing.add_to_compound(seg, poly.into()); } maybe_seg } - pub fn add_zone_fixed_seg_infringably( + pub fn add_poly_fixed_seg_infringably( &mut self, from: FixedDotIndex, to: FixedDotIndex, weight: FixedSegWeight, - zone: GenericIndex, + poly: GenericIndex, ) -> FixedSegIndex { let seg = self.add_fixed_seg_infringably(from, to, weight); - self.drawing.add_to_compound(seg, zone.into()); + self.drawing.add_to_compound(seg, poly.into()); seg } @@ -199,10 +199,10 @@ impl Layout { self.drawing.move_dot(dot, to) } - pub fn add_zone(&mut self, weight: ZoneWeight) -> GenericIndex { - GenericIndex::::new( + pub fn add_poly(&mut self, weight: PolyWeight) -> GenericIndex { + GenericIndex::::new( self.drawing - .add_compound(CompoundWeight::Zone(weight)) + .add_compound(CompoundWeight::Poly(weight)) .petgraph_index(), ) } @@ -243,18 +243,18 @@ impl Layout { } } - pub fn zones( + pub fn polys( &self, node: GenericIndex, ) -> impl Iterator> + '_ { self.drawing.compounds(node) } - pub fn zone_nodes(&self) -> impl Iterator> + '_ { + pub fn poly_nodes(&self) -> impl Iterator> + '_ { self.drawing.rtree().iter().filter_map(|wrapper| { if let NodeIndex::Compound(compound) = wrapper.data { - if let CompoundWeight::Zone(..) = self.drawing.compound_weight(compound) { - return Some(GenericIndex::::new(compound.petgraph_index())); + if let CompoundWeight::Poly(..) = self.drawing.compound_weight(compound) { + return Some(GenericIndex::::new(compound.petgraph_index())); } } @@ -262,10 +262,10 @@ impl Layout { }) } - pub fn layer_zone_nodes( + pub fn layer_poly_nodes( &self, layer: usize, - ) -> impl Iterator> + '_ { + ) -> impl Iterator> + '_ { self.drawing .rtree() .locate_in_envelope_intersecting(&AABB::from_corners( @@ -274,8 +274,8 @@ impl Layout { )) .filter_map(|wrapper| { if let NodeIndex::Compound(compound) = wrapper.data { - if let CompoundWeight::Zone(..) = self.drawing.compound_weight(compound) { - return Some(GenericIndex::::new(compound.petgraph_index())); + if let CompoundWeight::Poly(..) = self.drawing.compound_weight(compound) { + return Some(GenericIndex::::new(compound.petgraph_index())); } } @@ -283,13 +283,13 @@ impl Layout { }) } - pub fn zone_members( + pub fn poly_members( &self, - zone: GenericIndex, + poly: GenericIndex, ) -> impl Iterator + '_ { self.drawing .geometry() - .compound_members(GenericIndex::new(zone.petgraph_index())) + .compound_members(GenericIndex::new(poly.petgraph_index())) } pub fn drawing(&self) -> &Drawing { @@ -304,8 +304,8 @@ impl Layout { self.drawing.rules_mut() } - pub fn zone(&self, index: GenericIndex) -> Zone { - Zone::new(index, self) + pub fn poly(&self, index: GenericIndex) -> Poly { + Poly::new(index, self) } pub fn via(&self, index: GenericIndex) -> Via { diff --git a/src/layout/mod.rs b/src/layout/mod.rs index a0ea8e6..21eca73 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1,5 +1,5 @@ mod layout; +pub mod poly; pub mod via; -pub mod zone; pub use layout::*; diff --git a/src/layout/zone.rs b/src/layout/poly.rs similarity index 73% rename from src/layout/zone.rs rename to src/layout/poly.rs index f2c9fbd..5b5125a 100644 --- a/src/layout/zone.rs +++ b/src/layout/poly.rs @@ -26,13 +26,13 @@ pub trait GetMaybeApex { } #[derive(Debug)] -pub struct Zone<'a, R: AccessRules> { - pub index: GenericIndex, +pub struct Poly<'a, R: AccessRules> { + pub index: GenericIndex, layout: &'a Layout, } -impl<'a, R: AccessRules> Zone<'a, R> { - pub fn new(index: GenericIndex, layout: &'a Layout) -> Self { +impl<'a, R: AccessRules> Poly<'a, R> { + pub fn new(index: GenericIndex, layout: &'a Layout) -> Self { Self { index, layout } } @@ -48,9 +48,9 @@ impl<'a, R: AccessRules> Zone<'a, R> { } } -impl<'a, R: AccessRules> GetLayer for Zone<'a, R> { +impl<'a, R: AccessRules> GetLayer for Poly<'a, R> { fn layer(&self) -> usize { - if let CompoundWeight::Zone(weight) = + if let CompoundWeight::Poly(weight) = self.layout.drawing().compound_weight(self.index.into()) { weight.layer() @@ -60,7 +60,7 @@ impl<'a, R: AccessRules> GetLayer for Zone<'a, R> { } } -impl<'a, R: AccessRules> GetMaybeNet for Zone<'a, R> { +impl<'a, R: AccessRules> GetMaybeNet for Poly<'a, R> { fn maybe_net(&self) -> Option { self.layout .drawing() @@ -69,7 +69,7 @@ impl<'a, R: AccessRules> GetMaybeNet for Zone<'a, R> { } } -impl<'a, R: AccessRules> MakePolyShape for Zone<'a, R> { +impl<'a, R: AccessRules> MakePolyShape for Poly<'a, R> { fn shape(&self) -> PolyShape { PolyShape { polygon: Polygon::new( @@ -103,7 +103,7 @@ impl<'a, R: AccessRules> MakePolyShape for Zone<'a, R> { } } -impl<'a, R: AccessRules> GetMaybeApex for Zone<'a, R> { +impl<'a, R: AccessRules> GetMaybeApex for Poly<'a, R> { fn maybe_apex(&self) -> Option { self.layout .drawing() @@ -123,61 +123,61 @@ impl<'a, R: AccessRules> GetMaybeApex for Zone<'a, R> { #[enum_dispatch(GetLayer, GetMaybeNet)] #[derive(Debug, Clone, Copy, PartialEq)] -pub enum ZoneWeight { - Solid(SolidZoneWeight), - Pour(PourZoneWeight), +pub enum PolyWeight { + Solid(SolidPolyWeight), + Pour(PourPolyWeight), } -impl From> for GenericIndex { - fn from(zone: GenericIndex) -> Self { - GenericIndex::::new(zone.petgraph_index()) +impl From> for GenericIndex { + fn from(poly: GenericIndex) -> Self { + GenericIndex::::new(poly.petgraph_index()) } } #[derive(Debug, Clone, Copy, PartialEq)] -pub struct SolidZoneWeight { +pub struct SolidPolyWeight { pub layer: usize, pub maybe_net: Option, } -impl GetLayer for SolidZoneWeight { +impl GetLayer for SolidPolyWeight { fn layer(&self) -> usize { self.layer } } -impl GetMaybeNet for SolidZoneWeight { +impl GetMaybeNet for SolidPolyWeight { fn maybe_net(&self) -> Option { self.maybe_net } } -impl From> for GenericIndex { - fn from(zone: GenericIndex) -> Self { - GenericIndex::::new(zone.petgraph_index()) +impl From> for GenericIndex { + fn from(poly: GenericIndex) -> Self { + GenericIndex::::new(poly.petgraph_index()) } } #[derive(Debug, Clone, Copy, PartialEq)] -pub struct PourZoneWeight { +pub struct PourPolyWeight { pub layer: usize, pub maybe_net: Option, } -impl<'a> GetLayer for PourZoneWeight { +impl<'a> GetLayer for PourPolyWeight { fn layer(&self) -> usize { self.layer } } -impl<'a> GetMaybeNet for PourZoneWeight { +impl<'a> GetMaybeNet for PourPolyWeight { fn maybe_net(&self) -> Option { self.maybe_net } } -impl From> for GenericIndex { - fn from(zone: GenericIndex) -> Self { - GenericIndex::::new(zone.petgraph_index()) +impl From> for GenericIndex { + fn from(poly: GenericIndex) -> Self { + GenericIndex::::new(poly.petgraph_index()) } } diff --git a/src/specctra/design.rs b/src/specctra/design.rs index 0e9c448..887d9d6 100644 --- a/src/specctra/design.rs +++ b/src/specctra/design.rs @@ -6,7 +6,7 @@ use thiserror::Error; use crate::{ board::{mesadata::AccessMesadata, Board}, drawing::{dot::FixedDotWeight, seg::FixedSegWeight, Drawing}, - layout::{zone::SolidZoneWeight, Layout}, + layout::{poly::SolidPolyWeight, Layout}, math::Circle, specctra::{ mesadata::SpecctraMesadata, @@ -389,8 +389,8 @@ impl SpecctraDesign { net: usize, maybe_pin: Option, ) { - let zone = board.add_zone( - SolidZoneWeight { + let poly = board.add_poly( + SolidPolyWeight { layer, maybe_net: Some(net), } @@ -399,7 +399,7 @@ impl SpecctraDesign { ); // Corners. - let dot_1_1 = board.add_zone_fixed_dot_infringably( + let dot_1_1 = board.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { pos: Self::pos(place_pos, place_rot, pin_pos, pin_rot, x1, y1), @@ -408,9 +408,9 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); - let dot_2_1 = board.add_zone_fixed_dot_infringably( + let dot_2_1 = board.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { pos: Self::pos(place_pos, place_rot, pin_pos, pin_rot, x2, y1), @@ -419,9 +419,9 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); - let dot_2_2 = board.add_zone_fixed_dot_infringably( + let dot_2_2 = board.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { pos: Self::pos(place_pos, place_rot, pin_pos, pin_rot, x2, y2), @@ -430,9 +430,9 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); - let dot_1_2 = board.add_zone_fixed_dot_infringably( + let dot_1_2 = board.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { pos: Self::pos(place_pos, place_rot, pin_pos, pin_rot, x1, y2), @@ -441,10 +441,10 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); // Sides. - board.add_zone_fixed_seg_infringably( + board.add_poly_fixed_seg_infringably( dot_1_1, dot_2_1, FixedSegWeight { @@ -452,9 +452,9 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); - board.add_zone_fixed_seg_infringably( + board.add_poly_fixed_seg_infringably( dot_2_1, dot_2_2, FixedSegWeight { @@ -462,9 +462,9 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); - board.add_zone_fixed_seg_infringably( + board.add_poly_fixed_seg_infringably( dot_2_2, dot_1_2, FixedSegWeight { @@ -472,9 +472,9 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); - board.add_zone_fixed_seg_infringably( + board.add_poly_fixed_seg_infringably( dot_1_2, dot_1_1, FixedSegWeight { @@ -482,7 +482,7 @@ impl SpecctraDesign { layer, maybe_net: Some(net), }, - zone, + poly, ); } @@ -568,8 +568,8 @@ impl SpecctraDesign { net: usize, maybe_pin: Option, ) { - let zone = board.add_zone( - SolidZoneWeight { + let poly = board.add_poly( + SolidPolyWeight { layer, maybe_net: Some(net), } @@ -578,7 +578,7 @@ impl SpecctraDesign { ); // add the first coordinate in the wire path as a dot and save its index - let mut prev_index = board.add_zone_fixed_dot_infringably( + let mut prev_index = board.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { pos: Self::pos( @@ -595,13 +595,13 @@ impl SpecctraDesign { maybe_net: Some(net), }, // TODO: This manual retagging shouldn't be necessary, `.into()` should suffice. - //GenericIndex::new(zone.petgraph_index()).into(), - zone, + //GenericIndex::new(poly.petgraph_index()).into(), + poly, ); // iterate through path coords starting from the second for coord in coords.iter().skip(1) { - let index = board.add_zone_fixed_dot_infringably( + let index = board.add_poly_fixed_dot_infringably( FixedDotWeight { circle: Circle { pos: Self::pos(place_pos, place_rot, pin_pos, pin_rot, coord.x, coord.y) @@ -612,11 +612,11 @@ impl SpecctraDesign { maybe_net: Some(net), }, // TODO: This manual retagging shouldn't be necessary, `.into()` should suffice. - zone, + poly, ); // add a seg between the current and previous coords - let _ = board.add_zone_fixed_seg_infringably( + let _ = board.add_poly_fixed_seg_infringably( prev_index, index, FixedSegWeight { @@ -625,7 +625,7 @@ impl SpecctraDesign { maybe_net: Some(net), }, // TODO: This manual retagging shouldn't be necessary, `.into()` should suffice. - zone, + poly, ); prev_index = index;