Problem in creating a DatumPlane

Report observations made with the new Toponaming branch.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Problem in creating a DatumPlane

Post by jpg87 »

1- I am creating a master sketch in the XZ plane directly from Sketcher WB.
2- I create a body in PartDeszign WB. From PartDesign, I visualize the Y axis then I select Vertex 1 of the master sketch in order to create a Datum Line passing through Vertex 1 and parallel to Y.
PbDatumPlane01.png
PbDatumPlane01.png (51.46 KiB) Viewed 1501 times
3- Still in PartDeszign WB, I select Vertex 2 of the master sketch then the Datum Line to create a plane passing through 3 points.
PbDatumPlane02.png
PbDatumPlane02.png (58.89 KiB) Viewed 1501 times
Unexpected result:
The Datum Plane, then of course the sketch, show a Y shift of 0.333333 mm.

Where does this come from?

@realthunder , @wmayer

Even if the procedure is not exactly the same, the lag occurs as much in the LinkStage version as in the Master version.
Attachments
PbDatumPlaneFC_LinkStage.FCStd
(15.48 KiB) Downloaded 41 times
PbDatumPlaneFC_0.21.FCStd
(10.5 KiB) Downloaded 42 times
My website : http://help-freecad-jpg87.fr updated 2023/11/06
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: Problem in creating a DatumPlane

Post by chrisb »

You can see the problem already in the first sketch: Hover over a line of Sketch and see in the status bar that the longer line is between 0 and 4nm off.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Problem in creating a DatumPlane

Post by jpg87 »

@chrisb

Yes but why ? This sketch was constructed in the XZ plane !
My website : http://help-freecad-jpg87.fr updated 2023/11/06
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Problem in creating a DatumPlane

Post by Roy_043 »

I don't think Chris's analysis is correct, the 'real' coords are accurate enough.
  1. Select the Sketch.
  2. Ctrl+Shift+P.
  3. Paste this in the Python console:

    Code: Select all

    [v.Point for v in shp.Vertexes]
  4. Result:

    Code: Select all

    [
      Vector (-25.0, 0.0, 0.0), 
      Vector (68.96926207859083, 7.594372760115067e-15, 34.20201433256686), 
      Vector (58.70865777882078, 1.3853983062116296e-14, 62.39279295614411)
    ]
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Problem in creating a DatumPlane

Post by jpg87 »

@Roy_043
Thank you for your suggestion, but I get this:

Code: Select all

Python 3.8.6+ (heads/3.8-dirty:a12f459ec2, Nov  5 2020, 12:01:10) [MSC v.1927 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> [v.Point for v in shp.Vertexes]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'shp' is not defined
>>> 
Maybe I'm not doing the right thing? or am I doing it wrong?
I imagined that in an XZ plane all points had a (totally) zero Y coordinate...
In any case, the 4 nm shown by @chrisb are far from the 0.333 mm observed for the offset of my DatumPlane.
My website : http://help-freecad-jpg87.fr updated 2023/11/06
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Problem in creating a DatumPlane

Post by Roy_043 »

Sorry, I should have explained that I tested PbDatumPlaneFC_0.21.FCStd in Master.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.21.30193 (Git)
Build type: Release
Branch: master
Hash: a8cb4e744483ce2c4b0770b948105a766330a4b2
Python 3.8.13, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: Dutch/Netherlands (nl_NL)
Installed mods: 
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: Problem in creating a DatumPlane

Post by chrisb »

I am not sure how attaching something to XZ-plane is actually performed. These deviations look as if this attachment is not done directly, but rather by turning from XY-plane. That may involve some trigonometric functions creating some rounding errors. But even with those is a deviation in the nm range already rather big leave alone the mm.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Problem in creating a DatumPlane

Post by jpg87 »

The test in

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.30265 (Git)
Build type: Release
Branch: master
Hash: c35244e74f326a04c5bcab31e984742db582ac78
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: French/France (fr_FR)
Installed mods: 
  * A2plusSavTraduc
  * Assembly3 0.11.3
  * BIM 2021.12.0
  * BOLTSFC
  * Curves 0.5.5
  * DynamicData 2.46.0
  * fasteners 0.4.2
  * fcgear 1.0.0
  * IconThemes
  * PieMenu
  * symbols_library
The response :

Code: Select all

Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:30:19) [MSC v.1929 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> [v.Point for v in shp.Vertexes]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'shp' is not defined
>>> 
My website : http://help-freecad-jpg87.fr updated 2023/11/06
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Problem in creating a DatumPlane

Post by jpg87 »

chrisb wrote: Tue Sep 06, 2022 8:17 am But even with those is a deviation in the nm range already rather big leave alone the mm.
I agree.
But it's only in this plan construction method that I've noticed this type of discrepancy.
My website : http://help-freecad-jpg87.fr updated 2023/11/06
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Problem in creating a DatumPlane

Post by adrianinsaval »

Did you actually select the sketch and press ctrl+shift+p? If that doesn't work try right click->send to python console
Post Reply