You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sweeping a rectangular profile along a parametric wave path, the profile's orientation changes incorrectly as the sweep progresses. This happens regardless of whether isFrenet is set to True or False. The sweep initially aligns with the path correctly but distorts as it continues, making the result inconsistent.
Code Example
Below is a minimal, complete example to reproduce the issue. This can be copied and run directly in CQ-Editor:
`import cadquery as cq
import math
Parameters for the wave spring
t1 = 0 # Start parameter
t2 = 50 # End parameter
num_points = 500 # Number of points for smoothness
radius = 50
(width, thickness) = (4, 2)
Generate the wave spring path
points = []
delta_t = (t2 - t1) / num_points
for i in range(num_points + 1):
t = t1 + i * delta_t
# Parametric equations for the wave spring
x = radius * math.sin(t)
y = radius * math.cos(t)
z = 7 * math.sin(3.5 * t) + 3 * t
points.append((x, y, z))
Create the wave path as a spline
wave_path = cq.Workplane("XY").spline(points)
Define a rectangular profile and sweep along the path
result = (
cq.Workplane("YZ") # Profile aligned to XZ plane
.center(radius, 0) # Offset to the radius of the wave spring
.rect(width, thickness) # Create a rectangle profile
.sweep(wave_path, isFrenet=False) # Sweep along the wave path
)`
Observed Behavior
The sweep starts with the profile aligned correctly to the path.
As the path progresses, the profile's orientation distorts and deviates from the intended alignment.
Expected Behavior
The rectangular profile should maintain consistent orientation along the entire wave path, ensuring a uniform sweep.
Screenshots
Sweep with normal=(0,0,1):
Sweep with no normal:
Sweep with a circular profile (for comparison)(best to understand how it changes with the path as the path(black line) goes from outward to inward)
The text was updated successfully, but these errors were encountered:
Same situation I think, sweeping a wire profile along a spline wave does not work properly (or as expected).
Minimal example:
import cadquery as cq
import numpy as np
support = cq.Workplane("XY").rect(50, 100).offset2D(5)
nodes = [support.consolidateWires().val().positionAt(t) + cq.Vector(0, 0, 2+2np.sin(20np.pi*t)) for t in np.linspace(0,1,100)]
sweepingPath = cq.Workplane("XY").polyline(nodes).close() # or .spline
When sweeping a rectangular profile along a parametric wave path, the profile's orientation changes incorrectly as the sweep progresses. This happens regardless of whether
isFrenet
is set toTrue
orFalse
. The sweep initially aligns with the path correctly but distorts as it continues, making the result inconsistent.Code Example
Below is a minimal, complete example to reproduce the issue. This can be copied and run directly in CQ-Editor:
`import cadquery as cq
import math
Parameters for the wave spring
t1 = 0 # Start parameter
t2 = 50 # End parameter
num_points = 500 # Number of points for smoothness
radius = 50
(width, thickness) = (4, 2)
Generate the wave spring path
points = []
delta_t = (t2 - t1) / num_points
for i in range(num_points + 1):
t = t1 + i * delta_t
# Parametric equations for the wave spring
x = radius * math.sin(t)
y = radius * math.cos(t)
z = 7 * math.sin(3.5 * t) + 3 * t
points.append((x, y, z))
Create the wave path as a spline
wave_path = cq.Workplane("XY").spline(points)
Define a rectangular profile and sweep along the path
result = (
cq.Workplane("YZ") # Profile aligned to XZ plane
.center(radius, 0) # Offset to the radius of the wave spring
.rect(width, thickness) # Create a rectangle profile
.sweep(wave_path, isFrenet=False) # Sweep along the wave path
)`
Observed Behavior
The sweep starts with the profile aligned correctly to the path.
As the path progresses, the profile's orientation distorts and deviates from the intended alignment.
Expected Behavior
The rectangular profile should maintain consistent orientation along the entire wave path, ensuring a uniform sweep.
Screenshots
Sweep with normal=(0,0,1):
Sweep with no normal:
Sweep with a circular profile (for comparison)(best to understand how it changes with the path as the path(black line) goes from outward to inward)
The text was updated successfully, but these errors were encountered: