2

When in need to draw an illustration in 2d or even 3d, one can use a mark-up language like svg or pgf. Both produce vector based illustrations, they are good and can produce very nice results.

One shortcoming of such vector based languages is the absence of ray tracing.

And when in need to draw an object of a more complicated shape and of less "mathematical" shape, (like a cup or a mug and not to mention an airplane or a space shuttle), one needs a 3d modeling program.

I am looking for a way to include in my (LaTeX) documents a vector drawing of a 3d object that still retains the position of the lighting source and specularity of the object. Adding a perspective point-of-view would be great as well. For example, note the gray color gradient in the following image:

enter image description here

(It is a screenshot from SolidWorks)

So let's say that I use either SolidWorks, SkethUp, Blender, Adobe Illustrator and the like for the 3d modeling. To what format should I export it so I can include it in a vector format in my document?

My observation is that content requiring rendering methods will always be rasterized during export to (for example) pdf.

And besides, all(?) 3D modeling formats store the object as if formed by a collection of adjacent triangles, or lines and polygons (DXF, STL, X3D and more). So information about color is not there at all.

But I have seen in some e-book versions of undergraduate textbooks a few vector drawings of 3d objects (like a figure describing an apparatus of the discussed experiment).

Then how can I do it?

I want to include a "3d engineering drawing" of the objects with gray-to-white color gradients that give the perception of the light source position, so the reader can tell which surface is at the front and which one is rather at the back; Something more colorful than the last drawing in this answer.

Let me know if this is do-able at all. Perhaps it is do-able only for "not-too-complicated" objects so one can work-out the color gradients manually?

5
  • 1
    Hi. Welcome to GDSE. 2D Vector software generally has no support for 3D objects/models created in 3D software. Just export from your 3D software as a high resolution raster image, perhaps convert to CMYK if you need that. You don't need vectors for printing. Raster images work perfectly fine. You can also place raster images in vector software such as Illustrator. If you need to change colours, do it in your 3D software, and export as raster again.
    – Billy Kerr
    Commented Oct 28, 2022 at 19:09
  • Most 3d software with only save renders in raster formats. 3d as vector and usable in other non-3d text or layout applications is essentially a unicorn. Although, Illustrator can have 3d Objects internally, and native .ai file can be placed into other Adobe apps. (illustrator's 3d is pretty rudimentary though)
    – Scott
    Commented Oct 28, 2022 at 22:18
  • the vector drawings are manually drawn. in a 2D vector application. you can offcourse colorize the vector outline with gradients. But the vector format specifications arent super conductive for this kind of work.
    – joojaa
    Commented Oct 29, 2022 at 5:26
  • @Scott i wouldnt say its 3D. the new ones are but they are raster only.
    – joojaa
    Commented Oct 29, 2022 at 5:30
  • Yeah but you can still build with the legacy 3D effects.
    – Scott
    Commented Oct 29, 2022 at 5:31

2 Answers 2

3

Ive been working on this for a really long time. Ultimately, the question boils down to what do you consider to be vector graphics. The 3D application is in fact a vector graphics engine of sorts. Its just that the accepted definition of a vector drawing is:

  • A file that follows SVG, PDF or a flavor of post script (like EPS) standard.

None of these are super conductive for the problem at hand. I mean if we would define OpenGl as a vector language, which it almost decidedly is some superset of, as it shares all the features of said formats. Then boom no problem.

So the problem purely lies in the definition of what does the rendering. Everything in the end needs to be some sort of pixel like entities (like because printer rasters don't need to at a fundamental technical level be pixels but something close to that anyway).

So there is no easy solution in realm of PDF

Simply because PDF does not have the kind of primitives that would make shading of this kind done without encountering a scientifically hard problem (hard as in we have no idea how to even start solving the problem).

A human can off course manually lay out a number of layers of gradients and gradient meshes on top of each other. But this is essentially just as hard problem as learning to draw the edges manually without a reference to a 3d model. Off course having a 3d model to base your decisions on is making this a bit easier. This would also make a very very unefficient vector file.

Could a rendering engine do it? Not currently, no. Our mathematical arsenal is not sophisticated enough for making analytic solvers for this. This was attempted as early as 1970's and there are still people working on it. Its just that i think that we kind off collectively passed the point where we would even seriously consider this again in mid 00's.

An AI system could be made, but to be honest our current AI has a real problem with the kind of simplicity needed for vector drawing manufactured items. But eventually yes though i think at that time we might reconsider our vector formats.

Can you do it?

Possibly, but if you must ask then no your probably a few months, at minimum, away form even attempting to do it seriously.

So i consider the problem a bit convoluted to attack. I have a workflow for it, but i realize that most people who read this would consider my workflow to be decidedly on the side of insanity. So i wont go there, but mostly because the write up would take 100 to 1000 screens full of text and im not there yet.

What to do insiead?

Overlay the vector edges, or use them as a mask for a grayscale image.

And besides, all(?) 3D modeling formats store the object as if formed by a collection of adjacent triangles,

No, most Document Content Creation (DCC) formats are like that. That is because they don't actually care of anything other than the illusion of a image and its just easier to spam triangles. Most 3D CAD applications build on a B-Rep model where things are really curved this is heavier. (which is partly why the linked answer works so well, because i have that extra data to play with)

But likewise a PDF is also like that just in a slightly more conductive format for painting, but if you look at the raw data i don't think you'll get much further than this either.

I understand that this answer does not help you much

But that is because this is a reasoned way of saying "NO".

0

I have seen 3D models in a PDF document. It was made only to try the possibility to include 3D models. The maker of the PDF said the models were exported from a 3D program as "PDF facets". The rendering happened in Adobe Reader. One could rotate, zoom and adjust light to some degree. In that sense the models were vectors.

Unfortunately I cannot tell can you produce those PDF facets and I do not know which PDF readers support them today. But try!

1
  • Yes, but this does not do the rendering of the shadows or the smooth ambient occlusions unless you use textures that are raster images which is what we were trying to avoid. But yeah doing this is relatively easy just that the viewing does not work very well across different readers. So technially your at same point as before, but with a harder technical stack. Most CAD apps do this directly, solidworks does for example, but the results are essentially not really awesome looking. Also doe snot work for PRINT
    – joojaa
    Commented Oct 31, 2022 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.