Thank you @Chris_G for showing me this solution. Indeed it's a way to do things.
It also works for splines, so with this approach the step distribution can now fairly accurately be controled for general curved stairs.
Thanks again!
Thank you @Chris_G for showing me this solution. Indeed it's a way to do things.
Could you slightly elaborate the logic behind how Sketch is Mapped / Stretched ? Can't imagine after studying a few examples how the stairs were mapped on different surface
Hi @hammax, and thanks for the alternative version, this could help me in other contexts, however, in this case there is an anomaly in the generation of the surfaces, which has some areas with crossed CVs and consequently generates a wavy surface.
The main tool is a Quad face (a simple flat BSpline surface) that acts as a flat map of the target face.
Code: Select all
from FreeCAD import Vector
cone = Part.makeCone(5, 2, 10).Face1
Part.show(cone, "Cone")
u0, u1, v0, v1 = cone.ParameterRange
Code: Select all
quad = Part.BSplineSurface()
quad.setUKnots([u0, u1])
quad.setVKnots([v0, v1])
quad.setPole(1, 2, Vector(0, 10, 0))
quad.setPole(2, 1, Vector(20, 0, 0))
quad.setPole(2, 2, Vector(20, 10, 0))
map = quad.toShape()
Part.show(map, "Quad")
Code: Select all
box = Part.makeBox(3, 3, 3)
box.Placement = FreeCAD.Placement(Vector(12, 3, 3), Vector(0.7, -0.7, -0.2), 35)
Part.show(box, "Box")
Code: Select all
proj = map.project([box])
Part.show(proj, "Box projection")
edges = []
for e in proj.Edges:
cos, fp, lp = map.curveOnSurface(e)
edges.append(cos.toShape(cone, fp, lp))
box_on_cone = Part.Compound(edges)
Part.show(box_on_cone, "box_on_cone")
Hi Chris_G, I saw that the B-Spline curve icon is misleading, it represents a B-Spline from the control points, but actually a B-Spline is created through the points,