How to project a curve onto a cylindrical surface?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

How to project a curve onto a cylindrical surface?

Post by freecad-heini-1 »

Hello,
which possibilities are there in Freecad to project a closed Reflect-Lines (curves-workbench) onto an outer cylindrical surface?
In this way, I was able to create very good parting surfaces in Creo for tool- and mould making. The reflect lines and the projection curve of the cylinder surface have to be connected afterwards only by loft.
Who knows a trick how to project onto a cylindrical surface?
A scaled clone doesn't quite return the result I'm looking for.
Many greetings
Wilfried
project_reflect-lines_to_cylinder-face.png
project_reflect-lines_to_cylinder-face.png (33.75 KiB) Viewed 2489 times
project_to_cylindrical_face.FCStd
(202.64 KiB) Downloaded 89 times
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by microelly2 »

there is no default method but it is simple to map the coordinates of some discretized points of the curve to cylindric coordinates and than normalize the radius.
I will look for the script, I'm sure I had it already.
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by saso »

Maybe not exactly what you need but it does give you quite a lot of room to play with the parameters and get different results out of it...

Note:
- I have not made the final loft surface between the section and the reflectlines
- I have scaled the clone only in X an Z directions (not Y)
- with the scale and placement properties of the clone one can get a lot of flexibility on the shape of the section curve
- this is just a quick test of the first idea I had and so I did not check if it is fully parametric or search for ways to make it
Attachments
project_to_cylindrical_face (1).FCStd
(407.47 KiB) Downloaded 66 times
Last edited by saso on Tue Jul 30, 2019 11:22 am, edited 2 times in total.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by microelly2 »

saso wrote: Tue Jul 30, 2019 10:56 am Maybe not exactly what you need but it does give you quite a lot of room to play with the parameters and get different results out of it...

Note:
- I have not made the final loft surface between the section and the reflectlines
- I have scaled the clone only in X an Z directions (not Y)
- with the scale and placement properties of the clone one can get a lot of flexibility on the section curve
- I did not check if it is fully parametric or search for ways to make it
It's an intersting solution.
Here my method

Code: Select all

import numpy as np

s=App.activeDocument().ReflectLines001.Shape

eds=[]
for e in s.Edges:
    pts2=[]
    pts=e.discretize(100)
    for p in pts:
        h=p.y
        arc=np.arctan2(p.x,p.z)
        r=FreeCAD.Vector(p.x,p.z).Length
        R=150
        p2=FreeCAD.Vector(np.sin(arc)*R,h,np.cos(arc)*R)
        pts2 += [p2]

    Part.show(Part.makePolygon(pts2))


The results are the same
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by saso »

microelly2 wrote: Tue Jul 30, 2019 11:00 am The results are the same
Yes, it was also my first curious idea to check (compare) that after I generated yours :)
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by microelly2 »

I still have a little bit to fight with the self connecting cylinder face but this is a use case of uv projection from pyflow too.
the same result.
cp_019.png
cp_019.png (141.53 KiB) Viewed 2441 times
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by freecad-heini-1 »

microelly2 wrote: Tue Jul 30, 2019 11:43 am I still have a little bit to fight with the self connecting cylinder face but this is a use case of uv projection from pyflow too.
the same result.
cp_019.png
Hi Thomas,
that looks good. Many thanks to you and Saso for the help. Please upload your Freecad file, because I want to create the loft face to be able to judge it.
Many greetings
Wilfried
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: How to project a curve onto a cylindrical surface?

Post by freecad-heini-1 »

saso wrote: Tue Jul 30, 2019 10:56 am - I have scaled the clone only in X an Z directions (not Y)
This gives a very useful result.
If you want an angle of attack to center the two halves of the mould to each other, you can also scale the other axis. Thank you.
User avatar
hammax
Veteran
Posts: 1991
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: How to project a curve onto a cylindrical surface?

Post by hammax »

… a solution with the means of PartWB and slice:
ProJCurve.PNG
ProJCurve.PNG (40.85 KiB) Viewed 2413 times
Attachments
proj_cylindrical_face_2.FCStd
FC.19.17300
(405.6 KiB) Downloaded 91 times
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: How to project a curve onto a cylindrical surface?

Post by kisolre »

freecad-heini-1 wrote: Tue Jul 30, 2019 12:29 pm This gives a very useful result.
But he probably had to downgrade your original ReflectLines because they had overlapping edges and simply cloning and lofting gives wrong result. Are those overlapping lines supposed to be there?
Post Reply