Vrml Render Issues

Discussion in 'Design and Modeling' started by GatCat, Dec 6, 2016.

  1. GatCat
    GatCat Member
    I am creating some tabletop game tokens, and printing in full color sandstone is a great option for what I'm doing. The problem is, when I array the part to make multiple copies of it, something happens in the VRML file that screws up the color on consecutive parts. In the picture I have uploaded, I copied the token 12x (I do this to bring the cost per item down) and you can see that each part gets progressively worse until they are just black. The first one comes out perfect. I know this because I put in an order thinking that maybe it was just a weird render issue on the Shapeways end. Nope, it's something on my end and I cannot find the answer. Help! I'm using Solidworks (don't judge me).
     

    Attached Files:

  2. mkroeker
    mkroeker Well-Known Member
    Is your model using vertex colors or a separate texture image ? (It could even be that some parts of it have both, you would see the sum of both colors at each pixel).
    Use a vrml/x3d viewer like view3dscene to see if it looks wrong even before it enters shapeways' automatic checks and repairs. If it looks good there, check your mesh for holes, overlaps or misoriented normals. (It could be that shapeways' software has to add or remove vertices to make the file printable, which usually messes with coloring). If there is a texture image involved, how big is it, and do all game pieces use the exact same texture or are there twelve independent copies ?
     
  3. GatCat
    GatCat Member
    I'm not using a texture image, so the problem isn't there. I've also tried using 12 individual items (in an assembly) and 12 copied items (in the part file) and in different patterns and I still get the same issue. The VRML viewers are showing the same errors, so I know it is not just Shapeways. It's definitely on the Solidworks end.
     
  4. mkroeker
    mkroeker Well-Known Member
    VRML is (somewhat) readable text, so you may be able to find what is different - though it is unlikely that it will be as simple as copying a material declaration from the correct pattern to the others. Perhaps there are several ways in SolidWorks to do the copy operation, and one of them works ?
    If you are somewhat familiar with programming, you could also try a hackish approach - export one single pattern to VRML, and then copy the contents of that file (except its header) eleven times, adding "appropriate" Transform {translate X Y Z} blocks around the copies. (VRML started out as a macro language for OpenGL graphics way back when that was still called SGI GL and ran on expensive refrigerator-sized workstations. So at least in the early days when the standard did not mandate all the machine-friendly redundancy it was not unusual to hand-code objects and entire scenes.)
     
  5. GatCat
    GatCat Member
    Yeah, I did look at the text file, and it was enough to scare me away. While I could probably figure it out, the amount of time it would take me to learn it seems like it might not be worth it. I may give it a shot anyway. Let's say I knew what I was doing... How long do you suppose this operation would take?
     
  6. mkroeker
    mkroeker Well-Known Member
    Hard to guess without knowing the exact structure of what SolidWorks writes, but probably about an hour for
    copying everything between "Shape{" and the associated closing brace "}" a few times and adding an outer "Transform{translation X Y Z children [" and "]}" with appropriately spaced X,Y,Z values around each.
    (If you intend to use SolidWorks for more than just this one token set, it would still make more sense to find a
    solution for the underlying SolidWorks problem, or find a modeling software that can read the VRML and allows
    you to copy and arrange objects. (Not sure if meshlab does this, and even less sure if you want to look into using Blender.)
     
  7. GatCat
    GatCat Member
    I contacted my Solidworks support company (I run a subscription for my real job) and they looked into the VRML export issue, and found some information that helped me out. Here's what you have to do:

    1. When coloring your part, don't color solid bodies. Rather, color faces and features. This is important to remember, because naturally I wanted to color the body of the part itself, so that I wouldn't have to color in features later that were going to be my "default" color for the part.

    2. Save part, and open in an assembly. Arrange the parts as desired in the assembly, and then save the assembly.

    3. Save the assembly as a part. I know, I know, seems strange, but it worked for me. This saves the whole thing as a part file again, with the copies/duplicates of the original part also intact, in a new part file. Part files handle the VRML export better than assemblies, I think.

    4. Open the new part file you have created, and export THAT as your VRML file.

    5. Finally, don't have too many colors/features/patterns in your part. When things start getting complicated, the VRML will still not export correctly. Keep it simple.

    And that's it! It worked for me. It's a bit of a hassle, because then you need 3 separate part files (the original 1x part, the assembly file, and the assembly saved as a part). This may only be an issue if you are trying to do what I was trying to do, which was pattern multiples of a small part and export as a VRML file, but I find it hard to believe I'm the only one who has tried to do this on Shapeways. If I just wanted to export ONE part with no duplicates, everything seemed to be working fine.

    Putting this here in hopes that somebody will find it useful. I'm off to order some parts!