Datum Plane orientation request
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Datum Plane orientation request
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.
-
- Posts: 439
- Joined: Tue Apr 04, 2017 6:06 pm
- Location: SF Bay Area, California
Re: Datum Plane orientation request
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.
Re: Datum Plane orientation request
me too ... but I would be absolutely unable to write the corresponding code.
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Datum Plane orientation request
Where did you get this? App::Placement shows differently in my build. Did you modify it?
Re: Datum Plane orientation request
yes, in ~/src/Gui/ViewProviderPlacement.cpprealthunder wrote: ↑Tue Feb 05, 2019 12:40 am Where did you get this? App::Placement shows differently in my build. Did you modify it?
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";
}
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Datum Plane orientation request
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.
Re: Datum Plane orientation request
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.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.
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.
Re: Datum Plane orientation request
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...
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.
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...
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.