Skip to content

Commit

Permalink
Merge pull request #571 from jrmobley/2d-export
Browse files Browse the repository at this point in the history
Fix 2D exporter conversion lookups.
  • Loading branch information
gumyr authored Feb 27, 2024
2 parents 9edf411 + 6e33dfc commit ec495d5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/build123d/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,10 @@ def _convert_other(self, edge: Edge, attribs: dict):
# A dictionary that maps geometry types (e.g., LINE, CIRCLE, ELLIPSE, BSPLINE)
# to their corresponding conversion methods.
_CONVERTER_LOOKUP = {
GeomType.LINE.name: _convert_line,
GeomType.CIRCLE.name: _convert_circle,
GeomType.ELLIPSE.name: _convert_ellipse,
GeomType.BSPLINE.name: _convert_bspline,
GeomType.LINE: _convert_line,
GeomType.CIRCLE: _convert_circle,
GeomType.ELLIPSE: _convert_ellipse,
GeomType.BSPLINE: _convert_bspline,
}

def _convert_edge(self, edge: Edge, attribs: dict):
Expand Down Expand Up @@ -1344,10 +1344,10 @@ def _other_element(self, edge: Edge) -> ET.Element:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

_SEGMENT_LOOKUP = {
GeomType.LINE.name: _line_segments,
GeomType.CIRCLE.name: _circle_segments,
GeomType.ELLIPSE.name: _ellipse_segments,
GeomType.BSPLINE.name: _bspline_segments,
GeomType.LINE: _line_segments,
GeomType.CIRCLE: _circle_segments,
GeomType.ELLIPSE: _ellipse_segments,
GeomType.BSPLINE: _bspline_segments,
}

def _edge_segments(self, edge: Edge, reverse: bool) -> list[PathSegment]:
Expand All @@ -1358,10 +1358,10 @@ def _edge_segments(self, edge: Edge, reverse: bool) -> list[PathSegment]:
return result

_ELEMENT_LOOKUP = {
GeomType.LINE.name: _line_element,
GeomType.CIRCLE.name: _circle_element,
GeomType.ELLIPSE.name: _ellipse_element,
GeomType.BSPLINE.name: _bspline_element,
GeomType.LINE: _line_element,
GeomType.CIRCLE: _circle_element,
GeomType.ELLIPSE: _ellipse_element,
GeomType.BSPLINE: _bspline_element,
}

def _edge_element(self, edge: Edge) -> ET.Element:
Expand Down

0 comments on commit ec495d5

Please sign in to comment.