Datum Plane orientation request

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Datum Plane orientation request

Post by chrisb »

That's only for attachments and sketch creation. As the body's origin they should have the possibility to hide them.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Datum Plane orientation request

Post by GeneFC »

chrisb wrote: Fri Jan 25, 2019 7:31 pm As the body's origin they should have the possibility to hide them.
Of course, but that is just one more click that is not quite so necessary if the symbol is simpler.

Gene
Mark Szlazak
Posts: 439
Joined: Tue Apr 04, 2017 6:06 pm
Location: SF Bay Area, California

Re: Datum Plane orientation request

Post by Mark Szlazak »

GeneFC wrote: Fri Jan 25, 2019 7:17 pm I prefer the simple tri-vector used for the axis cross. All of those extra lines in the origin style add a lot of clutter.

Gene
I agree.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Datum Plane orientation request

Post by chrisb »

I agree, if we have a selection mechanism for the different planes: Selecting two arrows results in selecting that plane.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Datum Plane orientation request

Post by Zolko »

GeneFC wrote: Fri Jan 25, 2019 7:17 pm I prefer the simple tri-vector used for the axis cross. All of those extra lines in the origin style add a lot of clutter.
me too ... but I would be absolutely unable to write the corresponding code.
try the Assembly4 workbench for FreCAD — tutorials here and here
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Datum Plane orientation request

Post by realthunder »

Zolko wrote: Fri Jan 25, 2019 9:26 am Something like these ?
Where did you get this? App::Placement shows differently in my build. Did you modify it?
LCS_AxisCross.png
LCS_AxisCross.png (202.38 KiB) Viewed 2413 times
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Datum Plane orientation request

Post by Zolko »

realthunder wrote: Tue Feb 05, 2019 12:40 am Where did you get this? App::Placement shows differently in my build. Did you modify it?
yes, in ~/src/Gui/ViewProviderPlacement.cpp

Code: Select all

ViewProviderPlacement::ViewProviderPlacement()
{

    pMat = new SoMaterial();
    pMat->ref();

    const float dist = 1;
    const float size = 6;
    const float pSize = 4;
    const float head = 0.5;

    static const SbVec3f verts[25] =
    {
        SbVec3f(0,0,0), SbVec3f(size,0,0),
        SbVec3f(0,size,0), SbVec3f(0,0,size),
        SbVec3f(pSize,pSize,0), SbVec3f(dist,pSize,0), SbVec3f(pSize,dist,0),  // XY Plane
        SbVec3f(pSize,0,pSize), SbVec3f(dist,0,pSize), SbVec3f(pSize,0,dist),  // XY Plane
        SbVec3f(0,pSize,pSize), SbVec3f(0,pSize,dist), SbVec3f(0,dist,pSize),  // XY Plane
        SbVec3f(size-head,head/2.,0), SbVec3f(size-head,-head/2.,0),           // arrowhead X
        SbVec3f(size-head,0,head/2.), SbVec3f(size-head,0,-head/2.),           // arrowhead X
        SbVec3f(0,size-head,head/2.), SbVec3f(0,size-head,-head/2.),           // arrowhead Y
        SbVec3f(head/2.,size-head,0), SbVec3f(-head/2.,size-head,0),           // arrowhead Y
        SbVec3f(0,head/2.,size-head), SbVec3f(0,-head/2.,size-head),           // arrowhead Z
        SbVec3f(head/2.,0,size-head), SbVec3f(-head/2.,0,size-head)            // arrowhead Z
    };

    // indexes used to create the edges
    static const int32_t lines[45] =
    {
        0,1,-1,
        0,2,-1,
        0,3,-1,
        5,4,6,-1,
        8,7,9,-1,
        11,10,12,-1,
        13,1,14,-1,
        15,1,16,-1,
        17,2,18,-1,
        19,2,20,-1,
        21,3,22,-1,
        23,3,24,-1
    };

    pMat->diffuseColor.setNum(12);
    pMat->diffuseColor.set1Value(0, SbColor(0.8f, 0.2f, 0.2f));
    pMat->diffuseColor.set1Value(1, SbColor(0.2f, 0.5f, 0.2f));
    pMat->diffuseColor.set1Value(2, SbColor(0.2f, 0.2f, 0.8f));

    pMat->diffuseColor.set1Value(3, SbColor(0.2f, 0.2f, 0.8f));
    pMat->diffuseColor.set1Value(4, SbColor(0.2f, 0.5f, 0.2f));
    pMat->diffuseColor.set1Value(5, SbColor(0.8f, 0.2f, 0.2f));
    
    pMat->diffuseColor.set1Value(6, SbColor(0.8f, 0.2f, 0.2f));
    pMat->diffuseColor.set1Value(7, SbColor(0.8f, 0.2f, 0.2f));

    pMat->diffuseColor.set1Value(8, SbColor(0.2f, 0.5f, 0.2f));
    pMat->diffuseColor.set1Value(9, SbColor(0.2f, 0.5f, 0.2f));

    pMat->diffuseColor.set1Value(10, SbColor(0.2f, 0.2f, 0.8f));
    pMat->diffuseColor.set1Value(11, SbColor(0.2f, 0.2f, 0.8f));

    pCoords = new SoCoordinate3();
    pCoords->ref();
    pCoords->point.setNum(25);
    pCoords->point.setValues(0, 25, verts);

    pLines  = new SoIndexedLineSet();
    pLines->ref();
    pLines->coordIndex.setNum(45);
    pLines->coordIndex.setValues(0, 45, lines);
    sPixmap = "view-measurement";
}
try the Assembly4 workbench for FreCAD — tutorials here and here
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Datum Plane orientation request

Post by realthunder »

Zolko wrote: Tue Feb 05, 2019 8:23 am yes, in ~/src/Gui/ViewProviderPlacement.cpp
Nice. I actually like this more. Besides, it can even select base planes. How about I just transplant this visual representation to datum cs? What it lacks is selection and preselection visual feedback, I can add that too.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Datum Plane orientation request

Post by Zolko »

realthunder wrote: Tue Feb 05, 2019 11:16 pm ]Nice. I actually like this more. Besides, it can even select base planes. How about I just transplant this visual representation to datum cs? What it lacks is selection and preselection visual feedback, I can add that too.
Concerning the squares that represent the main planes, there are pros and cons, I have no real opinion. I think this is how Catia V5 shows it. It's very practical if the squares can be used to select datum planes to draw sketches on them, but it clutters more the screen. If implemented, the behaviour could be set in the preferences.

But there is something that's more important in my eyes: that the size of the coordinate system remains constant on the screen, that it doesn't scale with the part when zooming in and out. This is how the Axis Cross behaves, how all coordinate system's representations behave in all other CAD systems, therefore, independently of the visual style, this should also bee FreeCAD's way of showing the DatumCS (PartDesign::CoordinateSystem). It's because of this behaviour that I thought about the AxisCrossKit, but may-be can the same thing be achieved by other means.
try the Assembly4 workbench for FreCAD — tutorials here and here
emills2
Posts: 866
Joined: Tue Apr 28, 2015 11:23 pm

Re: Datum Plane orientation request

Post by emills2 »

is there a reason this couldn't be applied as a visiblity option to all placements throughout FreeCAD? if it's done throughout, it's consistent. if it's only for the LCS object, it feels like it's looping back on itself. nothing too critical, but it feels off.

for all my stuff, i just draw the axes i care about in a sketch, and then consider that sketch to be an LCS, by pulling it's placement property when i need it. i can't show the z, but i know where it is. it's definitely nice to skip the step of drawing the axes, or the simple cases. some cases it's best to just get in there

here's an example: sketches placed on sketches placed on sketches...
Silk_model_148_03.png
Silk_model_148_03.png (271.16 KiB) Viewed 2225 times
edit: then an LCS is just a document object, that has a placement, like everything else. then you add your specific features, like labels, etc.

in your assembly system, you could then even simply layer an object on another by selecting an entire object as an LCS, since everything has a placement.
Post Reply