Sketcher construction line (blue) - how to change draw style to dashed?

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!
Post Reply
freecad-heini-1
Posts: 7478
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Sketcher construction line (blue) - how to change draw style to dashed?

Post by freecad-heini-1 » Thu Aug 09, 2018 7:13 am

Hi,
is there any possibility to change the sketcher construction (blue) solid draw style into dashed or a other draw style?
Please let me know.
Thank you and best regards
Wilfried

User avatar
bejant
Posts: 6076
Joined: Thu Jul 11, 2013 3:06 pm

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by bejant » Thu Aug 09, 2018 1:50 pm

Not from Edit > Preferences...

freecad-heini-1
Posts: 7478
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by freecad-heini-1 » Fri Aug 10, 2018 10:17 am

bejant wrote:
Thu Aug 09, 2018 1:50 pm
Not from Edit > Preferences...
I've checked all parameter but couldn't found anything. :cry:

User avatar
bejant
Posts: 6076
Joined: Thu Jul 11, 2013 3:06 pm

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by bejant » Fri Aug 10, 2018 9:44 pm

I didn't look through the Parameters, so I'm glad you did. It might be worth a feature request on the bug tracker (unless you can code it yourself). Your post made me think that it might be handy to be able to make the Construction Geometry segments thinner than the regular ones too.

wmayer
Site Admin
Posts: 16849
Joined: Thu Feb 19, 2009 10:32 am

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by wmayer » Sun Aug 26, 2018 12:00 pm

is there any possibility to change the sketcher construction (blue) solid draw style into dashed or a other draw style?
No, this is not possible because normal lines and constructions lines are inside the same group node. While the material node allows it to set a different color to each line segment this is not possible with a draw style node: the line pattern only allows a single value and thus is active on normal and construction lines.

amoose136
Posts: 1
Joined: Tue Nov 24, 2020 9:19 pm

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by amoose136 » Tue Nov 24, 2020 10:05 pm

Does anyone know where this is defined in the code? I would very much like to add this feature but I have very little idea how FreeCAD's code base is organized.

User avatar
Kunda1
Posts: 9209
Joined: Thu Jan 05, 2017 9:03 pm

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by Kunda1 » Tue Nov 24, 2020 10:59 pm

abdullah wrote: pinged by pinger macro
@abdullah would you happen to know where is the code for this ? And would this feature request be feasible in the current codebase ?
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features

abdullah
Posts: 3858
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by abdullah » Wed Nov 25, 2020 6:35 pm

Kunda1 wrote:
Tue Nov 24, 2020 10:59 pm
abdullah wrote: pinged by pinger macro
@abdullah would you happen to know where is the code for this ? And would this feature request be feasible in the current codebase ?
Code? Sure, in ViewProviderSketch.cpp:

Code: Select all

void ViewProviderSketch::createEditInventorNodes(void)
In particular:

Code: Select all

SoSeparator* curvesRoot = new SoSeparator;
    edit->EditRoot->addChild(curvesRoot);
    edit->CurvesMaterials = new SoMaterial;
    edit->CurvesMaterials->setName("CurvesMaterials");
    curvesRoot->addChild(edit->CurvesMaterials);

    MtlBind = new SoMaterialBinding;
    MtlBind->setName("CurvesMaterialsBinding");
    MtlBind->value = SoMaterialBinding::PER_FACE;
    curvesRoot->addChild(MtlBind);

    edit->CurvesCoordinate = new SoCoordinate3;
    edit->CurvesCoordinate->setName("CurvesCoordinate");
    curvesRoot->addChild(edit->CurvesCoordinate);

    drawStyle = new SoDrawStyle;
    drawStyle->setName("CurvesDrawStyle");
    drawStyle->lineWidth = 3;
    curvesRoot->addChild(drawStyle);

    edit->CurveSet = new SoLineSet;
    edit->CurveSet->setName("CurvesLineSet");
    curvesRoot->addChild(edit->CurveSet);
However, please focus on Werner's reply because it is key to understanding the thing. In plain English: All lines share a line style, normal white lines and construction lines, so if you change the style of curvesRoot to dashed, all lines will be dashed, construction and non-construction.

Longer answer: It is not efficient to have a per geometry node that would enable to customise every single line (visibility, style, ...). However, layers feature (which only exists in my head), would group geometries into layers and each layer will be shown/hidden independently, one could have a separate drawing style for a layer too. Aside from the obvious show/hide, I have considered in my head the possibility of changing the line style of internalalignment geometry. It could be possible to group all construction geometry into one layer and have this other layer have a separate drawing style. However, layers only exist in my head at this time.

I am currently reworking InternalAlignmentGeometry, mostly to have a new separate Weight constraint and allow for separate distinct visualitisation and stop using weights with milimeters inside. Something like this:
Screenshot_20201125_192624.png
Screenshot_20201125_192624.png (50.93 KiB) Viewed 152 times
Here the idea is that InternalAlignmentGeometry gets its own color and rules. For example, not being possible to make a circle radius equal to a pole weight. The weight constraint represent value is the actual weight value. The representation size depends on a scaling factor (currently getScaleFactor from the Sketcher, but this may change).

After InternalAlignmentGeometry, I will rework partly the Block constraint, although here I do not foresee an immediate increase in functionality, just an adaptation to use geometry extensions and maybe a more visual representation.

After that, I want to solve the issue of the sketcher points only being construction points.

If my job allows, I plan to have this for the new year...

User avatar
Kunda1
Posts: 9209
Joined: Thu Jan 05, 2017 9:03 pm

Re: Sketcher construction line (blue) - how to change draw style to dashed?

Post by Kunda1 » Wed Nov 25, 2020 6:49 pm

abdullah wrote:
Wed Nov 25, 2020 6:35 pm
However, please focus on Werner's reply
Thanks for the detailed response. I can appreciate the complexity a lot more now. Thank you kindly!
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features

Post Reply