Projecting curve onto face

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!
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Projecting curve onto face

Post by danielfalck »

Is there a way, either using the gui or with python of projecting a curve onto a face or surface?
Thanks.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Projecting curve onto face

Post by wmayer »

Code: Select all

import Part
from FreeCAD import Base
v=Base.Vector

c=Part.makeCircle(2,v(0,10,5),v(0,1,0))
s=Part.makeCylinder(4,10)
f=s.Face1
p=f.makeCylindricalProjection(c,v(0,1,0))
Part.show(p)
Part.show(c)
Part.show(s)
git commit 99d10a6
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Re: Projecting curve onto face

Post by danielfalck »

Thanks Werner. I see you created a method for conical projection too. Is there a way of dealing with flat faces also?

Thanks.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Projecting curve onto face

Post by wmayer »

Code: Select all

import Part
from FreeCAD import Base
v=Base.Vector

c=Part.makeCircle(2,v(5,5,5))
s=Part.makePlane(10,10)
f=s.Face1
p=f.makeCylindricalProjection(c,v(0,0,1))
Part.show(p)
Part.show(c)
Part.show(s)
The shape on what you project can be everything not just a cylinder. I used the terms "cylindrical" and "conical" from the class documentation which actually means parallel and perspective projection.
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Re: Projecting curve onto face

Post by danielfalck »

Ah, very good.
Thank you so much for adding this. I used to use Rhino3D and there were similar operations for projecting polylines onto surfaces. This is super cool. My intent is to use this for engraving on objects.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Projecting curve onto face

Post by wmayer »

I will rename the methods to "makeParallelProjection" and "makePerspectiveProjection" because it's less confusing then.
Wolpertinger
Posts: 1
Joined: Wed May 21, 2014 7:30 pm

Re: Projecting curve onto face

Post by Wolpertinger »

Thank you for posting this methodes....

I'm am newbie and I'm trying to find a way to model a ring with a text on (or in it), and I thought this could be smarter way instead of placing every single letter manually.... I tried to figure out how to use this methodes but I failed.

Is there any tutorial or good advice someone could give me? Thank you very much.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Projecting curve onto face

Post by yorik »

Thanks for that addition Werner, very useful!
*EDIT* *WOOPS* Just notice it was pretty old! How come I didn't see it! Thanks anyway! ;)
ujjwal
Posts: 6
Joined: Sat Dec 19, 2015 11:10 am

Re: Projecting curve onto face

Post by ujjwal »

Hi,
Please suggest the way to wrap a spline ( 2d) on a 3d surface. This is similar to CATIA's develop option.

I am a newbie to the design world, hence advice how to handle this codes ( files) also.

Regards
Ujjwal

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Projecting curve onto face

Post by DeepSOIC »

Hmm, interesting!
Post Reply