Sweep on 3D spline
- Dominant language
- Python
- Stars
- 5.8k
- Forks
- 541
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 5
Description
Dear Developers,
Thank you for this nice library. I have been trying to sweep a circle along a 3D curve path (curve with lot of bends). I followed the documentation and also previous issues. However when I try to implement them, I dont get the desired results. I am pretty sure, that I am doing something wrong. After having tried out all the suggestions in the previous issues and documentation, I still cant get it right. I would really appreciate your help.
Here is an example that I am trying to do
```
list_of_spline_points = [(26.0, 59.0, 3.0),
(24.0, 57.0, 10.0),
(21.0, 55.0, 20.0),
(19.0, 54.0, 30.0),
(16.0, 52.0, 40.0),
(15.0, 50.0, 51.0),
(14.0, 48.0, 61.0),
(12.0, 46.0, 71.0),
(11.0, 43.0, 81.0),
(11.0, 41.0, 91.0)]
```
The spline looks like this

```
import cadquery as cq
path = cq.Workplane("XY").spline(list_of_spline_points , includeCurrent=True)
defaultSweep = cq.Workplane("XY", origin=list_of_spline_points [0]).circle(2.0).sweep(path, makeSolid=True, isFrenet=True)
cq.exporters.export(defaultSweep, 'test.stl')
```
What I get in "test.stl"

I have also tried the below, however I get something similar to above
```
spline_edge = cq.Edge.makeSpline(list_of_spline_points )
spline_cq = cq.Workplane("XY")
spline_cq.objects = [spline_edge]
part = (cq.Workplane("XY").circle(2).sweep(spline_cq,
transition='transformed',
makeSolid=True,
isFrenet=True,
combine=True,
clean=True ))
cq.exporters.export(part, 'part.stl')
```
or
```
path = cq.Workplane("ZX").spline(list_of_spline_points, includeCurrent=True).val()
tangent_plane = cq.Plane(origin=path.positionAt(0), normal=path.tangentAt(0))
sweep = cq.Workplane(tangent_plane).circle(10).sweep(path)
cq.exporters.export(sweep , 'part.stl')
```
Thank you for the help,
Ravi.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.