CadQuery / CadQuery/cadquery

model may be merged on multiple svg export

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

Description

Here is a code that render 2 figures and export them in separated svgs:

```py
import cadquery as cq
from cadquery.cq import Workplane as WP
from cadquery.cq import Vector as V

cube1 = WP('YZ').move(1, 0).box(2, 2, 2)
cube2 = WP('XY').box(6, 3, 3)

def fig1():
return cube2.union(WP('XY').transformed(rotate=V(45, 0, 0)).box(6, 3, 3))

def fig2():
return cube2.union(WP('XY').transformed(rotate=V(0, 45, 0)).box(6, 3, 3))

def export(fig, fig_name):
cq.exporters.export(cube1.add(fig), fig_name, opt = {'showHidden': False})

export(fig1(), 'fig1.svg')
export(fig2(), 'fig2.svg')
```

The `fig1.svg` file is rendered as expected:

![image](https://user-images.githubusercontent.com/1665542/115902618-e7f0cb80-a462-11eb-9826-69dfda7129f0.png)

But in `fig2.svg`, fig1 and fig2 are merge together, instead of jut fig2.

![image](https://user-images.githubusercontent.com/1665542/115902701-fc34c880-a462-11eb-93e8-7ad48e8856c5.png)

If I comment the fig1 export line, fig2 is exported as expected:

![image](https://user-images.githubusercontent.com/1665542/115904276-e45e4400-a464-11eb-9213-b097f68a5143.png)

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.