I want to extrude a profile along a master curve, so that the profile curve is perpendicular to the master curve. I have tried it with Railrevolve, but it is not really good because the profile curve can point only to the gives axis. Is it possible? I have tried Extrude along but that does not work either.
What about Sweep-ing?
I have tried it but it seems to not working with closed curves.
Do it the analytic way (assuming that the profile is placed the classic way: PlaneXY):
- For each Curve crv in your crvList.
- For each Curve segment in crv.DuplicateSegments();
3a. If segment is first/last and crv is open get the tangent at start/end
3b. Else get the bisector with the previous/next segment tangent. - Compute the trim planes (tangent/bisector, CrossProduct(tangent/bisector, globalZ).
- Compute the Plane for classic PlaneToPlane trans (at a start offset found via trigonometry [use a box on profile and get a double d = box.X.Length + some tol] then offset is d/Math.Tan(tangents angle)). Find the end offset as well.
- Extend each segment both sides with the start/end offsets as above.
- Do the PlaneToPlane trans (5) and do a sweep on that extended rail.
- Trim the Brep with the trim Planes (4) - READ SDK about what part remains in relation to the plane normal.
- Cap (if you want closed Breps).
- Sample the pieces in some Tree.