CadQuery / CadQuery/cadquery

Intermediate path segments not being rendered until `close` call

Open
#1,429 4 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

This is probably more of a question, but also maybe a bug.

I really like the "automatic reload and preview" inside CQ-Editor.

I am trying to build up a complicated path using many `lineTo` calls, and want to have a preview as I am in the middle of this. However, in the CQ-Editor preview window, I don't see the entire path (only the last segment).

If I want to see the path so far, I need to call `close` at the end, and then it renders. But, I am not finished with the path yet and so don't want to close it.

This seems not related to CQ-Editor itself, because if you generate an SVG output for attached example, you get the same effect.

I am using `CadQuery` and `CQ-Editor` via `pip`.

```py
import cadquery as cq

# without the "close", only the last segment "lineTo(2,1)" is shown
result = cq.Workplane("XY").lineTo(1,2).lineTo(3,3).lineTo(2,1)

# with the "close", all segments are shown
# result = cq.Workplane("XY").lineTo(1,2).lineTo(3,3).lineTo(2,1).close()

with open('t.svg', 'w') as f:
f.write(result.toSvg())

show_object(result)

```

Screenshot:

![screenshot](https://github.com/CadQuery/cadquery/assets/79968074/440a159d-d25e-4cfe-b9ee-cf5d6f3baf95)

SVG output:
![output](https://github.com/CadQuery/cadquery/assets/79968074/7e314907-1dac-497c-af4f-9d8e9516b7db)

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.