Author Topic: UV Mapping a swept "pipe" - Solidworks meshing workflow  (Read 3729 times)

0 Members and 3 Guests are viewing this topic.

Offline Luke Wright

  • Newbie
  • *
  • Posts: 6
UV Mapping a swept "pipe" - Solidworks meshing workflow
« on: February 27, 2018, 09:38:20 am »
I have a swept "pipe" shape created in Solidworks that I have brought into Keyshot, both natively and in a variety of other formates (STL, STEP, and Parasolid). See first image below.


I'd like to apply a texture to this "pipe" that follows the contour of its path. Not unlike this garden hose, see second image below.


However, that is not the result that I get in Keyshot, regardless of the mapping option I use. See third image below.


I gather that this is a function of how Solidworks generates its meshes, something that we now have the option to mess with in SW2018 (called "ConvertMesh Bodies"). But the results of this option are useless in my case. See fourth image below.


I'm looking for solutions to this: other softwares, obscure file formats, Amazonian snake oils, whatever. How are you all solving these problems?

Disclaimers:
1. This is my first posting on this forum, so forgive my formatting errors
2. I apologize if this has been covered already, I have spent 8 full hours reading through forums without any reasonable answers. It, therefore, is a topic that deserves more attention.



Offline DMerz III

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 825
  • David Merz the Third
    • MerzTheThird
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #1 on: February 27, 2018, 12:17:22 pm »
 :) I have run into this before, let me save you some time! It isn't going to happen, at least not as you think it will.

If you want to try the new Triplanar mapping type in Keyshot, you might get halfway there (there will be seams in the texture, but you can softly blend them together). If you don' t want that, it is best if you just model the pipe polygonally in a program like Blender 3D (free) or Maya/3DsMax (not free unless you're a student), Cinema4D, or even Modo (not free).

From there you'll get an easy to unwrap piece of geometry, which you will unwrap inside of said program, import that geometry into Keyshot and then you can take advantage of the UV mapping type.

Trying to cut a seam along a mesh that was originally generated in a NURBs modeling software is not worth the pain and inevitable failure.

TLRD; Download Blender from Blender.org , learn how to sweep along a curve, convert that to a mesh, create a seam, unwrap, export geometry. You're done.

Best of luck!

Offline Luke Wright

  • Newbie
  • *
  • Posts: 6
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #2 on: February 27, 2018, 12:59:51 pm »
Thanks DMerz III!

Funny, that's exactly what I've been doing since posting this (great minds and all that...). I was trying to avoid the time and mental overhead of learning yet another software, but now that I'm dipping my toes into Blender, I can see numerous applications for it.

I will post my results.

Offline DMerz III

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 825
  • David Merz the Third
    • MerzTheThird
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #3 on: February 27, 2018, 01:14:09 pm »
Thanks DMerz III!

Funny, that's exactly what I've been doing since posting this (great minds and all that...). I was trying to avoid the time and mental overhead of learning yet another software, but now that I'm dipping my toes into Blender, I can see numerous applications for it.

I will post my results.

Please do, I was in your shoes not too long ago, Blender opened the door to a lot more possibility. It does have a good steep learning curve, but after about 20 hours in the program, suddenly it just clicks and so much makes sense, weird feeling when it happens. I highly recommend to anyone in need of a starting point to look at Blender Guru's Beginner Tutorial Series. It is by far the best 'beginner' series I've come across for free, and once you're done, you'll still be a newbie, but you will have gained confidence to keep learning. 

Ultimately, I've been working on a website to create tutorials and guides for these types of situations, there are not many resources for designers who are used to NURBs modeling, yet need to render or visualize a problem you're encountering. Just haven't gotten far enough, but the UV mapping part is definitely a good starting point.

Offline Luke Wright

  • Newbie
  • *
  • Posts: 6
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #4 on: February 27, 2018, 01:56:03 pm »
Blender, is it fare to criticize free software? It's a clunky program, but it got the job done.

First image is the tube I made in Blender.

Second image is that tube made into a mesh, that I "unwrapped"

Third image is the magical result in Keyshot.








Offline Luke Wright

  • Newbie
  • *
  • Posts: 6
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #5 on: February 27, 2018, 02:01:11 pm »
I need to find a way to accurately size this tube and position it in my scene, I'm assuming this can be done in Blender? I have a long ways to go...

Anything and everything you could want to know about how to use Blender is easy to find, but if anyone wants the exact workflow for what I did, I would be happy to post it, including links to the help articles I used.

Thanks, DMerz III, for the encouragement, I look forward to your tutorials.


Offline DMerz III

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 825
  • David Merz the Third
    • MerzTheThird
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #6 on: February 28, 2018, 11:57:46 am »
 :D great job, you figured that out faster than I would have when I started. In terms of getting scale accurate, here's my advice, you'll want to go to Blender > Scene Tab > Set the Units to Metric.

In your 3D View, if you hit 'N' you'll get properties, and in there you'll see dimensions and also scale. If you scale anything in blender, you'll always want to do 'ctrl+A' and hit Apply Scale, this will make sure your dimensions stay 1 to 1 (there's a longer explanation there, but because everything works off of math, having a scale of 1.0 regardless of your actual dimensions is the way to go).  When you export, I recommend you use FBX. The reason you'll want to do your dimensions in metric is because FBX only works in metric units, and there will be less confusion there if you stick with that. Otherwise you can export to OBJ, but there's a little more work to do in order to make proper scale in Keyshot on your import.

Hope some of that is helpful?

Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1670
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #7 on: February 28, 2018, 12:37:45 pm »
I need to find a way to accurately size this tube and position it in my scene, I'm assuming this can be done in Blender?

With KeyShot 7 you can export your KeyShot scene as fbx, open it in Blender (assuming it can open fbx's), create your pipe in blender in relation to the imported scene, export the pipe as fbx, import fbx tube into your original KeyShot scene making sure 'Keep original' under 'Location' is selected. This way it should fit exactly as you want it to.

Hope it helps,

Offline mattjgerard

  • Hero Member
  • *****
  • Posts: 1504
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #8 on: February 28, 2018, 02:24:00 pm »
With KeyShot 7 you can export your KeyShot scene as fbx, open it in Blender (assuming it can open fbx's), create your pipe in blender in relation to the imported scene, export the pipe as fbx, import fbx tube into your original KeyShot scene making sure 'Keep original' under 'Location' is selected. This way it should fit exactly as you want it to.

This is exactly my workflow for running wires and cables in my scenes, of which I do very often. Works fantastic.

Offline Luke Wright

  • Newbie
  • *
  • Posts: 6
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #9 on: March 01, 2018, 08:14:04 am »
Wow, Esben, thanks for the response.

You taught me everything I know about the material graph. Keep up the good work on YouTube!


Offline Luke Wright

  • Newbie
  • *
  • Posts: 6
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #10 on: March 01, 2018, 08:40:16 am »
Simple UV Mapping work-flow for Solidworks jockeys:

1. Create your object in SW
2. Export said object as an STL, using the coarsest settings you can get away with (options menu). Too fine a mesh will create a tangle of polylines that will be a nightmare to deal with in Blender.
3. Import the STL into Blender and follow Blender Guru's YouTube tutorial called "Blender Beginners UV Unwrapping Tutorial"
4. Export your newly unwrapped object as an OBJ file from Blender
5. Open the OBJ in Keyshot, apply your textures, and voila!

Things to note:
1. Maintain consistent units in each of the softwares, otherwise your scale will be off.
2. If the scale is off when you import into Keyshot, import your OBJ into SW to find out what scale factor you will need and then apply it in Keyshot.
3. Importing the OBJ into SW, then exporting it as an STL, then importing it into Keyshot will negate all your hard work. I'm not sure why I thought that was a good idea.
4. Place your seam (in Blender) where it will be hidden.
5. Use the "Solid" option for the Viewport Shading (Blender) when selecting edges for the split, "Wireframe" will make your eyes cross.

I hope this helps someone out there and saves them time.

Offline DMerz III

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 825
  • David Merz the Third
    • MerzTheThird
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #11 on: March 01, 2018, 08:55:23 am »
 :) Excellent!


Offline Esben Oxholm

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 1670
  • esbenoxholm.dk/keyshot-video-course
    • Freelance CG Artist
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #12 on: March 01, 2018, 12:33:29 pm »
Wow, Esben, thanks for the response.
You taught me everything I know about the material graph. Keep up the good work on YouTube!

Thanks, buddy! I'll do my best to keep'em coming :)

Offline MWo

  • Hero Member
  • *****
  • Posts: 875
  • Senior Technical Consultant @ INNEO (Germany)
    • german KeyShot page from INNEO Solutions
Re: UV Mapping a swept "pipe" - Solidworks meshing workflow
« Reply #13 on: March 02, 2018, 06:03:27 am »
In some cases it is possible to use UV mapping for single objects directly imported from Solidworks. Attached you'll find a Keyshot 7.2 KSP and a SWX 2013 Part with a single sweep. But the usage is limited to a few situations.
In SWX the sweep needs a single spline as a trajectory / path.

By the way: creo parametric files can be handled the same way. Even sketches and datum curves have to be copied curves with approximation. And this can be used with boundary blends, or sweeps and blend sweeps.

But keep pushing your Blender skills (I would like too, if I have the time!)


Cheers
Marco