CadQuery / CadQuery/cadquery

exportSvg doesn't hide edges that are partially visible

Open
#593 8 comments 0 reactions 0 assignees View on GitHub
svg
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

This code generates two boxes, one of them crossing the other one. When exporting to SVG with `exportSvg`, edges that start in a visible area and then _intersect_ the other object are rendered incorrectly.
If they _go behind_ the other object, they are rendered correctly.

**Incorrect**
from cadquery import cq, Compound
nl = list()
nl.append(cq.Workplane("XY").box(.1, 2, .1, centered=(True, True, True)).val())
nl.append(cq.Workplane("XY").box(2, 1, 1, centered=(True, True, True)).val())
comp = Compound.makeCompound(nl)
cq.Workplane(comp).exportSvg("boxes.svg")

![image](https://user-images.githubusercontent.com/784361/104957168-ed56f980-59cd-11eb-91d6-afc296b49ef5.png)

**Correct**
from cadquery import cq, Compound
nl = list()
nl.append(cq.Workplane("XY").box(.1, 2, .1, centered=(True , True, True)).**translate((0,0,-1)).val()**)
nl.append(cq.Workplane("XY").box(2, 1, 1, centered=(True, True, True)).val())
comp = Compound.makeCompound(nl)
cq.Workplane(comp).exportSvg("boxes2.svg")

![image](https://user-images.githubusercontent.com/784361/104957667-dfee3f00-59ce-11eb-80f0-8c496c3c50e8.png)

Cadquery 2.0 - Python 3.7 - Windows,

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.