LDraw.org Discussion Forums
SVG export from LDCAD? - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: SVG export from LDCAD? (/thread-23918.html)

Pages: 1 2


SVG export from LDCAD? - Milan Vančura - 2020-02-25

Hello.

I often work on making graphics around LEGO activities (book covers, tickets... also prints on bricks etc.). For this purpose it would be very handy to be able to get SVG output from LDCAD. AFAIK, there should be an indirect way using Blender, shouldn't it? Does anybody tested this path already? And/or is there an easier way?

Thanks a lot, Milan.


RE: SVG export from LDCAD? - Travis Cobbs - 2020-02-26

(2020-02-25, 12:30)Milan Vančura Wrote: I often work on making graphics around LEGO activities (book covers, tickets... also prints on bricks etc.). For this purpose it would be very handy to be able to get SVG output from LDCAD. AFAIK, there should be an indirect way using Blender, shouldn't it? Does anybody tested this path already? And/or is there an easier way?

Two things. First of all, "LDCad" is the name of a specific program. It's unclear if you are asking for an SVG output feature to be added to that program, or if you would like some LDraw-compatible program to support SVG output.

Secondly, LDView can do this, but it is bad enough that I never moved the feature out of experimental mode. It is disabled by default.

https://news.lugnet.com/cad/dev/?n=11145

Note: nothing has really changed in the almost nine years that have passed since the above post, although computers have gotten faster. The following reply to the above post contains instructions for enabling the feature:

https://news.lugnet.com/cad/dev/?n=11159


RE: SVG export from LDCAD? - Milan Vančura - 2020-02-26

(2020-02-26, 5:24)Travis Cobbs Wrote: Two things. First of all, "LDCad" is the name of a specific program. It's unclear if you are asking for an SVG output feature to be added to that program, or if you would like some LDraw-compatible program to support SVG output.
Thanks for the answer, Travis! Yes, I meant "some LDraw-compatible way", with additional info that I use LDCAD for modelling so if there is any specific function which can be used for that - like the export to blender format. I didn't know LDView can do it, thanks for the suggestion, I check it.


RE: SVG export from LDCAD? - Roland Melkert - 2020-02-26

(2020-02-26, 11:35)Milan Vančura Wrote: Thanks for the answer, Travis! Yes, I meant "some LDraw-compatible way", with additional info that I use LDCAD for modelling so if there is any specific function which can be used for that - like the export to blender format. I didn't know LDView can do it, thanks for the suggestion, I check it.

Export to blender is on my 1.7 feature list, see also:
https://forums.ldraw.org/thread-23915.html

Blender's recent support of USD seems to be a door opener.

Just looking for info etc as I can probably reuse big chunks of the POV export code.

Any additional pointers from experienced blender users will be very much appreciated.


RE: SVG export from LDCAD? - Milan Vančura - 2020-02-28

(2020-02-26, 5:24)Travis Cobbs Wrote: Note: nothing has really changed in the almost nine years that have passed since the above post, although computers have gotten faster. The following reply to the above post contains instructions for enabling the feature:

https://news.lugnet.com/cad/dev/?n=11159
Hi Travis. Unfortunately, I wasn't able to test this. Neither the cmdline option nor the same parameter in the config file made any change in Save snapshot behavior. Although I compiled LDView from source (current version from git) and I checked the commit with this feature is there (commit 75f35e318db0c2d8d06384613da145d98668e194).

So all I have is a picture you posted as an example. Watching that, this feature is probably too experimental for any practical usage now - but, on the other hand, if you could merge adjacent triangles of the same color and (optionally) turn off gradients simulation on studs, the result SVG must be significantly smaller and easier to render for any application, am I right? I only don't know how much effort it is, these two improvements... Maybe it's tooo much for such feature...


RE: SVG export from LDCAD? - Travis Cobbs - 2020-02-28

(2020-02-28, 12:49)Milan Vančura Wrote: Hi Travis. Unfortunately, I wasn't able to test this. Neither the cmdline option nor the same parameter in the config file made any change in Save snapshot behavior. Although I compiled LDView from source (current version from git) and I checked the commit with this feature is there (commit 75f35e318db0c2d8d06384613da145d98668e194).

So all I have is a picture you posted as an example. Watching that, this feature is probably too experimental for any practical usage now - but, on the other hand, if you could merge adjacent triangles of the same color and (optionally) turn off gradients simulation on studs, the result SVG must be significantly smaller and easier to render for any application, am I right? I only don't know how much effort it is, these two improvements... Maybe it's tooo much for such feature...

After enabling the feature, you didn't see EPS, SVG, and PDF as possible file types in the save dialog? Are you sure you spelled it right, and (on the command line) included the = before the 1? I'm pretty sure it still works.

As for improvements in the output, I use a 3rd-party library to convert my OpenGL commands, and I have no real control over it. I don't see it improving.


RE: SVG export from LDCAD? - Michael Horvath - 2020-02-29

(2020-02-28, 12:49)Milan Vančura Wrote: Hi Travis. Unfortunately, I wasn't able to test this. Neither the cmdline option nor the same parameter in the config file made any change in Save snapshot behavior. Although I compiled LDView from source (current version from git) and I checked the commit with this feature is there (commit 75f35e318db0c2d8d06384613da145d98668e194).

So all I have is a picture you posted as an example. Watching that, this feature is probably too experimental for any practical usage now - but, on the other hand, if you could merge adjacent triangles of the same color and (optionally) turn off gradients simulation on studs, the result SVG must be significantly smaller and easier to render for any application, am I right? I only don't know how much effort it is, these two improvements... Maybe it's tooo much for such feature...

I just tested it and it works but it is very slow and creates very large files, so there are not a lot of advantages right now compared to simply creating very large bitmap renders.

Blender has a SVG export add-on, but there has not been a good "path" between LDraw and Blender and vice versa so far.

It is possible that the other non-LDraw tools (I do not recall their names right now since I have been out of the loop for a long while) may have a better "path" to and from Blender.


RE: SVG export from LDCAD? - Milan Vančura - 2020-02-29

(2020-02-28, 23:17)Travis Cobbs Wrote: After enabling the feature, you didn't see EPS, SVG, and PDF as possible file types in the save dialog? Are you sure you spelled it right, and (on the command line) included the = before the 1? I'm pretty sure it still works.

As for improvements in the output, I use a 3rd-party library to convert my OpenGL commands, and I have no real control over it. I don't see it improving.
Exactly. After enabling the feature, I see the same options in Save snapshot dialog. I checked the spelling (even in sources) etc... The option name string is even in the compiled binary. But the effect is none.
Maybe it is because of my Linux Debian 10??

In the end it doesn't matter, probably and unfortunately. Because as you wrote you cannot improve the algorithm, this is a dead end anyway, isn't it? Unfortunately...

But thanks a lot and if you wish me to debug LDView on Linux, tell me and I help you as much as I can.


RE: SVG export from LDCAD? - Travis Cobbs - 2020-03-01

(2020-02-29, 21:49)Milan Vančura Wrote: Exactly. After enabling the feature, I see the same options in Save snapshot dialog. I checked the spelling (even in sources) etc... The option name string is even in the compiled binary. But the effect is none.
Maybe it is because of my Linux Debian 10??

In the end it doesn't matter, probably and unfortunately. Because as you wrote you cannot improve the algorithm, this is a dead end anyway, isn't it? Unfortunately...

But thanks a lot and if you wish me to debug LDView on Linux, tell me and I help you as much as I can.

This feature may not be supported by the Qt version.


RE: SVG export from LDCAD? - Stefan Frenz - 2020-03-01

(2020-02-29, 1:57)Michael Horvath Wrote: Blender has a SVG export add-on, but there has not been a good "path" between LDraw and Blender and vice versa so far.
As far as I know, Blender has a Wavefront OBJ import feature. If you like to give LDInspector a try, I would appreciate feedback for the LDInspector-integrated ldr/mpd-to-OBJ converter - this would be a one-way-path for ldr/mpd => obj => Blender.