Datum Plane orientation request

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
chrisb
Posts: 15781
Joined: Tue Mar 17, 2015 9:14 am

Re: Datum Plane orientation request

Postby chrisb » Fri Jan 25, 2019 7:31 pm

That's only for attachments and sketch creation. As the body's origin they should have the possibility to hide them.
GeneFC
Posts: 1007
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Datum Plane orientation request

Postby GeneFC » Fri Jan 25, 2019 7:45 pm

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: 386
Joined: Tue Apr 04, 2017 6:06 pm
Location: Edmonton, Canada

Re: Datum Plane orientation request

Postby Mark Szlazak » Fri Jan 25, 2019 11:13 pm

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
Posts: 15781
Joined: Tue Mar 17, 2015 9:14 am

Re: Datum Plane orientation request

Postby chrisb » Sat Jan 26, 2019 12:49 am

I agree, if we have a selection mechanism for the different planes: Selecting two arrows results in selecting that plane.
Zolko
Posts: 233
Joined: Mon Dec 17, 2018 10:02 am

Re: Datum Plane orientation request

Postby Zolko » Mon Jan 28, 2019 8:37 am

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.
realthunder
Posts: 962
Joined: Tue Jan 03, 2017 10:55 am

Re: Datum Plane orientation request

Postby realthunder » Tue Feb 05, 2019 12:40 am

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 467 times
Try Assembly3 (latest version 0.10.1) along 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
Zolko
Posts: 233
Joined: Mon Dec 17, 2018 10:02 am

Re: Datum Plane orientation request

Postby Zolko » Tue Feb 05, 2019 8:23 am

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";
}
realthunder
Posts: 962
Joined: Tue Jan 03, 2017 10:55 am

Re: Datum Plane orientation request

Postby realthunder » Tue Feb 05, 2019 11:16 pm

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 (latest version 0.10.1) along 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
Zolko
Posts: 233
Joined: Mon Dec 17, 2018 10:02 am

Re: Datum Plane orientation request

Postby Zolko » Fri Feb 08, 2019 8:46 am

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.
emills2
Posts: 564
Joined: Tue Apr 28, 2015 11:23 pm

Re: Datum Plane orientation request

Postby emills2 » Sat Feb 09, 2019 5:52 am

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 279 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.