how does sketcher defines local x and y

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

how does sketcher defines local x and y

Post by bernd »

if a face lies totally wired in space and a sketch is made from this face. How does the sketcher defines which direction is in Sketcher lokal x and lokal y from this face?
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: how does sketcher defines local x and y

Post by Gift »

I think from normal vector of the face. Edit: Oops, that is not enough. Hm. Maybe it use simple the UV mapping.

Code: Select all

doc = App.ActiveDocument
plane = doc.addObject('Part::Plane','Plane')
plane.Length=10
plane.Width=10
plane.Placement=App.Placement(App.Vector(-5.00,-5.00,0.00),App.Rotation(App.Vector(0.12,0.62,0.78),35.82))
plane.Label='TestPlane'
App.ActiveDocument.recompute()

face = plane.Shape.Faces[0]
sp = face.valueAt(0,0) # start point
face.valueAt(1,0).sub(sp) # x-axis
face.valueAt(0,1).sub(sp) # y-axis
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: how does sketcher defines local x and y

Post by jnxd »

I believe there is an open issue in the tracker (or probably just a forum post) requesting for the option to choose the axes. It seemed it was quite old, predating the introduction of datum coordinates.
My latest (or last) project: B-spline Construction Project.
Post Reply