9
$\begingroup$

In version 12.1, the docs say that it is now possible to export/import to a 3D file format while preserving textures:

formats

But I can't seem to find a single example of this new feature!

Code to try:

If you can figure out how get the texture on the exported cube, you've solved this problem. Here's a test:

vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 
     0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 
     1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 
     1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}, {{0, 0, 
     1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}};
Export["~/Downloads/test.fbx", 
 Graphics3D[{Texture[ExampleData[{"TestImage", "Sailboat"}]], 
   Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]}]]
SystemOpen@%

example

  • The FBX format can contain textures (for most other formats apps typically output textures as images into a directory).
  • Perhaps there is a way to generate an associated MTL file?
  • It looks like "STL" itself, according to Wikipedia, doesn't support textures inherently.
$\endgroup$
  • $\begingroup$ While I can see how colors can be represented, it doesn’t seem like the “STL” format even supports textures? Though it may come down to how one defines textures. If this refers to materials, then the format should support it. $\endgroup$ – CA Trevillian Mar 25 at 23:39
  • $\begingroup$ But FBX does, I've used .vrml in the past (with other apps). $\endgroup$ – M.R. Mar 26 at 1:26
  • $\begingroup$ I think .blend, .glb, and 3Dpdf all support embedded image textures, but those are not in $ExportFormats, @CATrevillian do you know of any other? $\endgroup$ – M.R. Mar 26 at 1:40
  • 1
    $\begingroup$ So, several things: FBX is not listed under the list of all 3D geometry formats, though it is of course included in that of $ImportFormats and $ExportFormats. When you take a look further down on the reference page for FBX, under Import Elements>”BinaryFormat”, it references STL so that might be one possible source of this claim of an updated STL. DAE makes the same claim as that of FBX as to optionally storing textures. None of the other mentioned formats seem to have been updated, and FBX is the only one to indicate it is new in the footer of the reference page. $\endgroup$ – CA Trevillian Mar 26 at 10:41
  • 1
    $\begingroup$ I was pretty certain that STL doesn't support textures directly and any ways to support it are non-standardized. $\endgroup$ – Carl Lange Mar 30 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.