Replies: 2 comments 4 replies
-
Have you read the ezdxf documentation? What have you tried so far and what problems did you encounter? |
Beta Was this translation helpful? Give feedback.
4 replies
-
Or ... write your custom backend based on the included SVGBackend. The class BackendProperties(NamedTuple):
"""The backend receives a condensed version of the entity properties."""
color: Color = "#000000"
lineweight: float = 0.25 # in mm
layer: str = "0" # maybe useful to group entities (SVG, PDF)
pen: int = 1 # equals the ACI (1-255), for pen based backends like plotters
handle: str = "" # top level entity handle
@property
def rgb(self) -> RGB:
"""Returns color as RGB tuple."""
return RGB.from_hex(self.color)
@property
def luminance(self) -> float:
"""Returns perceived color luminance in range [0, 1] from dark to light."""
return self.rgb.luminance |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to convert dxf into svg such that it preserves all geometry and group by layers
Beta Was this translation helpful? Give feedback.
All reactions