CadQuery / CadQuery/cadquery

I want to create a sweep of a parametric spline

Open
#972 1 comment 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

i want to sweep a circle with a parametric spline(whose points will be changed as per user). For this, i am struggling to find a method in which the circle plane should always be normal to spline at the starting point for a perfect sweep. Here is my code

pts = [
(20,50),
(25,75),
(30,125)
]
path = cq.Workplane("ZX").moveTo(5,25).spline(pts)
plane1 = cq.Workplane("ZY")
sweep = plane1.workplane(offset= -25).center(5,0).transformed(offset=(0, 0,), rotate=(0, -78.3, 0)).circle(10).sweep(path)

right now, my code is not parametrized and is hardcoded for one spline(though still circle not normal)

One approach we can do by calculating the tangent of the spline from its formulae but i don't know what cadquery use like cubic bezier curve or something else.

I also have a side query of how to join 2 paths sweep( for my case a line and a spline)
I am attaching a few SS for reference

![image](https://user-images.githubusercontent.com/98691815/151702512-73a54c03-59a8-4308-9ad9-7ff9f9b3b0ca.png)
![image](https://user-images.githubusercontent.com/98691815/151702529-6eebea80-6114-4431-b329-e9ab2588bd6d.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.