-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DXF export issue #1767
Labels
Comments
@antonysigma could you provide a MRE? |
@adam-urbanczyk , here you are. Thanks in advance! Python version: import cadquery as cq
from ocp_vscode import (
set_port,
show_object,
)
viewpoint = {
'top': (0, 0, 1),
'left': (1, 0, 0),
'front': (0, 1, 0),
}
def exportDXF3rdAngleProjection(my_part, prefix: str) -> None:
for name, direction in viewpoint.items():
cq.exporters.exportDXF(
my_part.rotateAboutCenter(direction, 90),
f"{prefix}{name}.dxf",
# Note: exportDXF is missing the following parameter.
#opt={
# "projectionDir": direction,
#},
doc_units=6,
)
def exportSVG3rdAngleProjection(my_part, prefix: str) -> None:
for name, direction in viewpoint.items():
cq.exporters.export(
my_part,
f'{prefix}{name}.svg',
opt={
'projectionDir': direction,
},
)
if __name__ == '__main__':
# Build the part
width = 10
depth = 10
height = 10.0
# !!! Test projection of fillets to arc segments in DXF. !!!
baseplate = (
cq.Workplane("XY") #
.box(width, depth, height)
.edges("|Z")
.fillet(2.0)
)
hole_dia = 3.0
# !!! Test projection of countersunk to arc segments in DXF. !!!
drilled = (
baseplate.faces(">Z") #
.workplane()
.cskHole(hole_dia, hole_dia * 2, 82.0)
)
# Expected DXF output to be identical to SVG output
exportSVG3rdAngleProjection(drilled, "")
exportDXF3rdAngleProjection(drilled, "")
# Initialize the ocp_vscode viewer
if False:
set_port(3939)
show_object(drilled) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally posted by @antonysigma in #122
The text was updated successfully, but these errors were encountered: