Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] DraftView - line style property not working #6733

Closed
2 tasks done
FEA-eng opened this issue Apr 11, 2022 · 10 comments · Fixed by #9530
Closed
2 tasks done

[Bug] DraftView - line style property not working #6733

FEA-eng opened this issue Apr 11, 2022 · 10 comments · Fixed by #9530
Assignees
Labels
Bug This issue or PR is related to a bug File format: SVG WB Draft Related to the Draft Workbench WB TechDraw Related to the TechDraw Workbench

Comments

@FEA-eng
Copy link
Contributor

FEA-eng commented Apr 11, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Forums discussion

https://forum.freecadweb.org/viewtopic.php?f=35&t=67928

Version

0.20 (Development)

Full version info

[code]
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28611 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Polish/Poland (pl_PL)
[/code]

Subproject(s) affected?

Techdraw

Issue description

DraftView objects have the Line Style property but it doesn't work - there's no drop-down list for it and typing in the style name (e.g. "Dashed") does nothing. Such property can be useful to turn draft objects to annotations.

The style of original Draft objects being turned into views is also not considered so there is no way to change the style of lines created by the DraftView tool.

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@luzpaz luzpaz added WB TechDraw Related to the TechDraw Workbench Bug This issue or PR is related to a bug labels Apr 12, 2022
@WandererFan WandererFan added WB Arch Related to the Arch Workbench WB Draft Related to the Draft Workbench labels Apr 12, 2022
@WandererFan
Copy link
Contributor

This has to be fixed on the Draft/Arch side, I believe.

@WandererFan
Copy link
Contributor

If you take the text of DraftView's Symbol property and give it to Inkscape you will get what looks like solid lines. Inkscape will tell you that in fact you have a line with a custom dash property, which is correct.

The issue is this code "stroke-dasharray:0.09,0.05" in the style attribute. This code creates a dashed line made up of very small dashes separated by very small gaps. The result appears as a continuous line.

@yorikvanhavre
Copy link
Member

The LineStyle property is working. The problem is that SVG is a bit delicate with line patterns... It gets scaled if placed inside a scaled group. The Draft get_svg() function normally takes care of this, at https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Draft/draftfunctions/svg.py#L52 but it still depends on what defaults are set under Edit->Preferences->Draft->Visual settings. So far I've been unable to find values that work for everyone. Some values work when you are working on a model of a building, but not when working on a screw model...

Not really sure how to handle this... Maybe the whole system needs to be redone with something more accurate, like "I want 3mm dashes with a 1mm spacing" and FreeCAD would do the whole calculation up to the printed sheet...

@yorikvanhavre yorikvanhavre removed the WB Arch Related to the Arch Workbench label May 12, 2022
@paullee0
Copy link
Contributor

@yorikvanhavre
Is it Edit->Preferences->Draft->Visual settings > SVG pattern default size, SVG pattern resolution, or otherwise ?

I try several numbers in both attributes and still no luck to see the dashed line :)

Thanks.

@Roy-043
Copy link
Contributor

Roy-043 commented Jul 21, 2022

SVG patterns refer to Draft Patterns. Why do you think these settings are related?

@paullee0
Copy link
Contributor

Just wild guess, the only two inputs with figures looks like multiplier ?

@luzpaz
Copy link
Contributor

luzpaz commented Apr 13, 2023

@yorikvanhavre do you mind revisiting this ?

@yorikvanhavre
Copy link
Member

On it!

@yorikvanhavre
Copy link
Member

Above commit implements more sensible default values that give good results at all scales:

Screenshot from 2023-05-10 09-56-54

@paullee0
Copy link
Contributor

Looks good :)

yorikvanhavre added a commit that referenced this issue May 15, 2023
Draft: Better svg linestyle settings - fixes #6733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug File format: SVG WB Draft Related to the Draft Workbench WB TechDraw Related to the TechDraw Workbench
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants