CadQuery / CadQuery/cadquery

STEP export of a swept tube with 90 angles leads to incorrect geometry

Open
#1,678 1 comment 0 reactions 0 assignees View on GitHub
OCC kernel issue
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

Hey there, would really like some help with this one, a fix or workaround would be appreciated. When I sweep a tube along a certain polyline path, it shows fine in CQ-Editor and the STL export. However the STEP export is broken. I also tried spline and bezier, those look fine.

Version information:
CQ-Editor: 0.3.0dev
Python: 3.11
CADquery: 2.4.0

Code to reproduce (I manually export the file from the UI, but a programmatical export is similar):

```
import cadquery as cq

# Create a circular profile (the inner and outer circles)
diameter_inner = 8
diameter_outer = 10

# Define the points for the spline path
pts = [
(0, 0, 0), # Start point
(0, 15, 0),
(0, 15, 15),
(0, 25, 15)
]

# Workplane on the XY plane
circle_profile = (
cq.Workplane("XZ")
.circle(diameter_outer / 2)
.circle(diameter_inner / 2)
)

# Create a path for the sweep
#path = cq.Workplane("XY").spline(pts)
path = cq.Workplane("XY").polyline(pts)
#path = cq.Workplane("XY").bezier(pts)

# Sweep the profile along the path
swept_shape = circle_profile.sweep(path, transition='round')

# Display the results
show_object(circle_profile)
show_object(path)
show_object(swept_shape)
```

Shows the following in CQ Editor:

![image](https://github.com/user-attachments/assets/d32ea400-1ca6-40cb-b2c4-1d0f796699be)

But a STEP Export leads to this:

![image](https://github.com/user-attachments/assets/c74f552a-3900-475f-a4b9-b9bb7dfd7a68)

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.