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

Option to export construction entities (to 2d view / PDF) #682

Closed
gnbl opened this issue Aug 22, 2020 · 10 comments · Fixed by #952
Closed

Option to export construction entities (to 2d view / PDF) #682

gnbl opened this issue Aug 22, 2020 · 10 comments · Fixed by #952

Comments

@gnbl
Copy link

gnbl commented Aug 22, 2020

SolveSpace version 3.0~6894b0c9 (https://ci.appveyor.com/api/buildjobs/rhtcbg18131udmto/artifacts/build%2Fbin%2FDebug%2Fsolvespace.exe) on Windows 10 64 bit.

I'd like to have construction entities (line segments) in the PDF export.
There does not seem to be an option to do this; points and construction entities are apparently not being exported.

The segment properties show

IN STYLE none
CONSTRUCTION

It would be nice to be able to click on none or another link to assign a style, which is possible via RMB context menu "Assign to Style". BTW, the menu item "Edit > Line Styles ..." does not work while an entity is selected, it is shown only when the entity is deselected.

Assigning a custom style to a construction line allows enabling the option "export these objects", but this does not take effect.

The Line Styles list shows the default style

s002-#def-construction

that does not have an additional option for export as the custom styles do.

The 'configuration' menu does not have an option either to allow export of construction entities.

So currently I cannot use construction geometry for my purpose (annotation of secondary geometry like doors etc. in a floor plan) and have to ignore the "not closed contour, or not all same style" error (I might try and use another sketch).

Potential solutions

  1. add global option for "export construction"
  2. use "export these objects" from custom style to override default behaviour of not exporting construction entities or raise an error, since the option otherwise does not have the anticipated effect (or disable option for construction geometry)
  3. show "export these objects" in default style for construction

Thanks!

@robnee
Copy link
Contributor

robnee commented Mar 5, 2021

@phkahler When looking into recent SVG export fixes I notice that this issue might be possible to address. I don't think we can make the construction style directly exportable. "export these objects" isn't available to change for the default styles. There is also no real way to "save" the construction style setting in the .slvs file since only custom styles are saved.

What we could do though is remove the explicit check that skips construction entities when exporting. We would also force the exportable flag to false for the construction default style (currently all default styles set export to true). This would preserve current behavior but If the user then restyled construction entities with a custom style that did have the export option enabled those entities would then export with the custom style.

it's not ideal and it is probably difficult for the user to discover but it should be simple to implement. It might be easier to demonstrate with a PR than to explain but I wanted your thoughts first.

@phkahler
Copy link
Member

phkahler commented Mar 5, 2021

I'm thinking the submitters idea 2 is the right thing to do since the option is already there but not working.

If exporting the built-in construction entities is desired, we can talk about weather that's a global option or a checkbox per style or something else. What do you think @robnee and @gnbl ?

@robnee
Copy link
Contributor

robnee commented Mar 5, 2021

I should have reread the OP. Idea 2 is essentially what I was suggesting. In fact I tried it and it works as expected. It's a simple change but it's not very discoverable. This is a per-file option (it's already part of the .slvs format) and the ability to have multiple custom styles for different construction entities makes it very flexible.

The configuration already has a number of export options so it might make sense to have another for "export construction entities". It's more discoverable and wouldn't require the user to restyle their construction entities. Maybe "export construction entities in 2D" or similar helps indicate for which exports it will apply. This option applies globally so is simple but less flexible.

I am happy with either approach really.

@gnbl
Copy link
Author

gnbl commented Mar 6, 2021

Any kind of option to allow this would be appreciated, so whatever is easiest to implement.
Thanks!

@gnbl
Copy link
Author

gnbl commented Mar 27, 2021

Finally got around to testing (3.0~53f5e4e7 Windows OpenMP) - awesome, thanks!

I've noticed two related things:

  • can't export light gray construction geometry to PDF (output appears identical with 0.1 or 0.9 brightness, minor difference to black visible with 0.2)
  • "line styles" > "load factory defaults" could automatically do a redraw

Let me know if you want two separate issues.

@robnee
Copy link
Contributor

robnee commented Mar 27, 2021

I'll look at automatically refreshing if resetting the styles. Is "Fix white lines on export" checked? That will draw light colors as black on export. Try turning that off to export light grey.

@gnbl
Copy link
Author

gnbl commented Mar 27, 2021

Yes, that was it. Thought it was to be taken literally. Thanks.

@gnbl
Copy link
Author

gnbl commented Mar 27, 2021

Ah but then actual construction geometry edges (active-grp) are exported white. Easily fixed by choosing a dark color before exporting. For frequent use a bit of a hassle - could the "fix light lines on export" option be per line-style as well? Or rather inherit the global option as is, but allow deselection for specific styles.
Sorry, just an idea.

@robnee
Copy link
Contributor

robnee commented Mar 27, 2021

That would affect the .slvs file format and would probably not get merged for backwards compatibility reasons. The lightest gray that will export without being changed to black is approx (0.77, 0.77, 0.77) as determined by:

sqrt((1-r)^2 + (1-g)^2 + (1-b)^2) < 0.4

Does that work for your purposes?

@gnbl
Copy link
Author

gnbl commented Mar 27, 2021

Thanks for taking the time to look into it. I'll give it a try. Meanwhile I've noticed that the default green for construction geometry isn't too bad after conversion to grayscale (for print).
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants