[SOLVED] - Sketch origin won't match part origin

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!
Lonfor
Posts: 133
Joined: Wed Mar 23, 2022 2:32 am

[SOLVED] - Sketch origin won't match part origin

Post by Lonfor »

I am using a sketch attached to a datum plane.
The expected behavior is that the part's origin will be projected to the datum plane's normal and therefore the sketch, but instead, the sketch's origin is at an apparent capricious position.
I tried to correct the origin coordinates but they are not editable.
This behavior is the same if the file is created with v0.19; 0.20 dev; or Link Branch. Also begs the question: Bug or feature?
Attached is the file made with v0.19.

Code: Select all

OS: KDE Flatpak runtime (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.14555 (Git shallow)
Build type: Release
Branch: (HEAD detached at 0.19.4)
Hash: 476ecf091941bead59b14e44afa6064d5a66afa3
Python version: 3.9.9
Qt version: 5.15.3
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
Attachments
Screenshot_20220526_213505.png
Screenshot_20220526_213505.png (232.7 KiB) Viewed 1017 times
metaldespl.FCStd
(15.05 KiB) Downloaded 23 times
Last edited by Lonfor on Sun May 29, 2022 7:26 am, edited 1 time in total.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Sketch origin won't match part origin

Post by freedman »

I think Sketcher has some rules to try and place the zero point, like if it can find a circle it will sometimes put it there but normally it just gets placed. You can move the sketch with the attachment offset.
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketch origin won't match part origin

Post by chrisb »

If the sketch is attached, you don't edit the Placement, you edit the AttachmentOffset. That is broken, you have to reattach it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
edwilliams16
Veteran
Posts: 3112
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Sketch origin won't match part origin

Post by edwilliams16 »

I just reattached the sketch001 to the Datum Plane and I got an attachment to edit. Not sure I understand...
Screen Shot 2022-05-26 at 7.13.12 PM.png
Screen Shot 2022-05-26 at 7.13.12 PM.png (48.47 KiB) Viewed 939 times
Attachments
metaldespl1.FCStd
(8.31 KiB) Downloaded 16 times
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Sketch origin won't match part origin

Post by freedman »

Not sure I understand...
Please give more info.

When an object is not attached we move it with placement. When attached, attachment properties are created and the object is moved with attachment offset, if the attachment is lost the attachment properties are removed.
Lonfor
Posts: 133
Joined: Wed Mar 23, 2022 2:32 am

Re: Sketch origin won't match part origin

Post by Lonfor »

chrisb wrote: Fri May 27, 2022 5:13 am AttachmentOffset
Okay. So the problem is not the sketch, but the datum plane that supports it. It has a disparate placement. See pic 1.
So I took a look at the Attachment Offset and everything looked fine. See Pic 2.
Then I deduced that if I compensate the Offset mismatch I would get the placement at the correct location. See pic 3.
However, it didn't happen and I've got mismatches even in micro millimeters. See pic 4. :shock:
Now I'm really confused.
Attachments
s1.png
s1.png (119.22 KiB) Viewed 900 times
s2.png
s2.png (139.94 KiB) Viewed 900 times
s3.png
s3.png (161.98 KiB) Viewed 900 times
s5.png
s5.png (121.09 KiB) Viewed 900 times
Bance
Veteran
Posts: 4187
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Sketch origin won't match part origin

Post by Bance »

It's caused by the DP's attachment.

Did you want it attached to Sketch?
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Sketch origin won't match part origin

Post by freedman »

It would be nice if we knew what you are trying to align. Typically we use sketch 0,0 as a origin to revolve or mirror and dimension from or rotate the sketch. The only reason to align datum plane 0,0 and sketch 0,0 is to make their rotation points the same, but I don't why you want that.
edwilliams16
Veteran
Posts: 3112
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Sketch origin won't match part origin

Post by edwilliams16 »

freedman wrote: Fri May 27, 2022 5:47 am
Not sure I understand...
Please give more info.

When an object is not attached we move it with placement. When attached, attachment properties are created and the object is moved with attachment offset, if the attachment is lost the attachment properties are removed.
I know that. What I didn’t understand was that in the OP’s file, it was showing as attached, but there was no attachment offset. I don’t know how he got into that state. When I reattached the same way the Offset appeared.
Lonfor
Posts: 133
Joined: Wed Mar 23, 2022 2:32 am

Re: Sketch origin won't match part origin

Post by Lonfor »

Bance wrote: Fri May 27, 2022 6:38 am It's caused by the DP's attachment.
Yup. But it looks like there is a faulty logic at where it is placed. It should be by default at 0,0.
freedman wrote: Fri May 27, 2022 6:42 am It would be nice if we knew what you are trying to align. Typically we use sketch 0,0 as a origin to revolve or mirror and dimension from or rotate the sketch. The only reason to align datum plane 0,0 and sketch 0,0 is to make their rotation points the same, but I don't why you want that.
I want the origin of the sketch (0,0) matching the part origin, or, its projection on the datum plane's normal. This is the standard behavior for all CAD packages with no exception that I know.
Last edited by Lonfor on Fri May 27, 2022 7:13 am, edited 1 time in total.
Post Reply