Layer and Colour in Techdraw

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
LegoCraft29
Posts: 13
Joined: Wed Oct 17, 2018 2:00 pm

Layer and Colour in Techdraw

Post by LegoCraft29 »

I use freecad 0.20. Today, i need colour in my techdraw 2D drawing, as my laser need it to apply parameter for cutting and engraving.
I try several solutions after trying to find information on the forum:
- Use classic 2D with cosmetic line. But it’s very long to select each small line.
- Use shape2dview which give a good result, but I can’t select a surface for solid hatch colour
- Use draftview with a combination of shape2view and part.
I finally discover that the use of the layer and a draftview give good results in techdraw.
You can find some of my trials in the attachment, but they are not a solution to the problem.
How to have some part with their own color in one view. ?
Is it easy to tweak "layer" to have sub-container I can use in draftview ?
How to have same part in several layer ?
Or do you have a solution ?.

Thanks for your help
Attachments
test_layer_v2.FCStd
exemple
(21.72 KiB) Downloaded 41 times
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Layer and Colour in Techdraw

Post by chrisb »

A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
LegoCraft29
Posts: 13
Joined: Wed Oct 17, 2018 2:00 pm

Re: Layer and Colour in Techdraw

Post by LegoCraft29 »

Thanks for your answer.

Of course decorateline give a solution, and I use on simple drawing.
But it not easy to use with complex drawing with lot of line to select, lot of part and views.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Layer and Colour in Techdraw

Post by Roy_043 »

What type of input do you need for your laser? Note that DraftViews cannot be exported to DXF.
LegoCraft29
Posts: 13
Joined: Wed Oct 17, 2018 2:00 pm

Re: Layer and Colour in Techdraw

Post by LegoCraft29 »

I use Trotec laser wich accept SVG.
If I print directly from freecad, it's convert everything in ugly BMP. So I open converted svg in Inkscape and just print it.
I should investigate if there's a solution to automatise colour definition by layer in inkscape. But I don't know exactly how attribute a SVG layer per part or object in freecad.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Layer and Colour in Techdraw

Post by Roy_043 »

Objects can be in a Draft_Layer and a Std_Group. Groups can be selected as the source for a DraftView. That may be useful. It is correct that solid fills cannot be added to a DraftView, but such a view does display the faces of objects.

Once thing to watch out for: a DraftView created from a box, as in your example, will produce an SVG with superimposed elements. That may be problematic for your application.
LegoCraft29
Posts: 13
Joined: Wed Oct 17, 2018 2:00 pm

Re: Layer and Colour in Techdraw

Post by LegoCraft29 »

I'm not sure to understand your idea.
I put some objects in Draft_Layer to define their face and line colour. I also put these same objects in a std_group.
But when I use draftview the colours disappear.
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: Layer and Colour in Techdraw

Post by domad »

LegoCraft29 wrote: Sun Nov 28, 2021 9:03 pm I'm not sure to understand your idea.
I put some objects in Draft_Layer to define their face and line colour. I also put these same objects in a std_group.
But when I use draftview the colours disappear.
Hello LegoCraft29, hello to the Community!
Could you tell us which file format you would prefer for your laser cutting, describe in more detail what you would like to obtain starting from what type of object (3D or 2D?), How your laser works, etc.
As already replicated by @Roy_043, surely someone here could advise you with more specificity.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Layer and Colour in Techdraw

Post by Roy_043 »

Groups offer some flexibility over relying only on layers. The elements in a group can belong to different layers.

Note that to create a DraftView from a Std_Group you have to use a workaround. First create the view by selecting a Draft object, and then edit its Source property.
Attachments
layer-group.png
layer-group.png (25.23 KiB) Viewed 3652 times
layer-group.FCStd
(22.85 KiB) Downloaded 32 times
LegoCraft29
Posts: 13
Joined: Wed Oct 17, 2018 2:00 pm

Re: Layer and Colour in Techdraw

Post by LegoCraft29 »

I try your solution but...
I start from a part, then i produce a shap2dview. And I never find solution to have color on surface.
I please your trick for the draftview and I try to group :
- part with shape2dview but without success
- 2 parts but it's give some strange result in techdraw (lack of face, cylinder draw as a line, bugs ??)

The group have a disadvantage as you can't put same object in two group, except with clone.
I will try more .
Attachments
layer-group_2.FCStd
(35.08 KiB) Downloaded 30 times
Post Reply