CadQuery / CadQuery/cadquery

Loft oddity (very specific offsets required between construction workplanes)

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

Description

Ran into a quite odd behavior with loft.

What I do:
Building a longer shape by lofting a number of sketches (with ruled=True, want minimal lofts). One speciality is that every two workplanes usually have offset = 0, because the shape should jump from one size to another.
Usually this works well. E.g. here an example of what I mean:
![loftshape](https://user-images.githubusercontent.com/1221177/131494505-34cb299e-afb6-4a38-b012-6f8abdc11e19.PNG)
which is the output of this program:
obj = cq.Workplane("XZ") \
.rect(10, 10) \
.workplane(offset=20) \
.rect(10, 10) \
.workplane() \
.rect(20, 20) \
.workplane(offset=20) \
.rect(20, 20) \
.workplane() \
.circle(30, ) \
.workplane(offset=20) \
.circle(30) \
.loft(ruled=True)

What happens:
Now for more complex problems offset 0 apparently isn't accepted anymore.
Have added three examples with increasing complexity and degree of odditiy:
[reproduce_loft_anomaly.zip](https://github.com/CadQuery/cadquery/files/7083543/reproduce_loft_anomaly.zip)

reproduce_loft_anomaly.py: First an example where all offsets can still be 0 - as expected

reproduce_loft_anomaly2.py: Here I add two new sketches. Now the offset between two previous sketches that could happily be 0 before has to be 0.0001
reproduce_loft_anomaly3.py: And when adding a whole bunch of other sketches, now one of the offsets has to be exactly 0.5 (neither 0.49 nor 0.51 work) and the one that previously had to be >= 0.0001 now has to be >= 0.001

The error message when changing the mentioned offsets in example 2 and 3 (see TODO in the example code for the locations of these offsets): StdFail_NotDone: BRep_API: command not done

Sorry that I couldn't simplify the examples more - then the effect disappeared.

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.