#357590
Hey guys - I need to render a lot of similar objects that have a lot of different mapping sections. I need to explode the items in order to map properly but then I need to join and perform a Boolean operation. Ideally I would be able to explode the item, assign mapping, join item, then Boolean and render. Am I missing something? I have so many objects to render that repeating these steps will take me a looooong time.
Thanks in advance!!
#357591
I don't think you can do that; once you join them, you have a polysurface, which has a single texture mapping. Most likely, you need to work with meshes, rather than NURBS -- something along the lines of: explode to the surfaces you want to map, convert them to meshes, do your mapping, join the pieces, and use a mesh boolean.
#357698
I don't think you can do that, exactly. There are two distinct steps that require human input: mapping the exploded surfaces, and deciding which mesh faces belong together, in order to perform the boolean. So, start with the first: getting mesh faces to texture map. Here is a RhinoScript to do that:
Code: Select all

  Sub MeshFacesFromNurbsObjects    
    Dim objects, surfaces, meshes    
    objects = Rhino.GetObjects("Select objects to mesh", 24)    
    If IsArray(objects) Then      
      surfaces = Rhino.ExplodePolysurfaces(objects)      
      If IsArray(surfaces) Then        
        Rhino.HideObjects objects
        Rhino.UnselectAllObjects
        Rhino.SelectObjects(surfaces)
        Rhino.Command "ExtractRenderMesh"
        Rhino.DeleteObjects(surfaces)      
      End If      
    End If      
  End Sub

If you read through that (RhinoScript reading pretty much like plain english), you'll see that it asks you to select some NURBS objects, makes duplicates of those you select, hides the originals, explodes the duplicates into surfaces, extracts meshes for each, and then deletes the temporary surfaces. Which means that you now have a bunch of mesh faces that you can texture map.

Once you've done your mapping, we have a second script:
Code: Select all

  Sub JoinAndDifferenceMeshFaces     
    Dim subtractThese, fromThese    
    subtractThese = Rhino.GetObjects("Select mesh faces to subtract", 32)  
    If IsArray(subtractThese) Then        
      fromThese = Rhino.GetObjects("Select mesh faces from which to subtract", 32)      
      If IsArray(fromThese) Then        
        Dim subtractThis, fromThis        
        Rhino.UnselectAllObjects
        Rhino.SelectObjects(fromThese)
        Rhino.Command "Join"
        fromThis = Rhino.LastCreatedObjects        
        If IsArray(fromThis) Then          
          Rhino.UnselectAllObjects
          Rhino.SelectObjects(subtractThese)
          Rhino.Command "Join"
          subtractThis = Rhino.LastCreatedObjects          
          If IsArray(subtractThis) Then            
            Rhino.MeshBooleanDifference fromThis, subtractThis            
          End If          
        End If         
      End If        
    End If     
  End Sub

This script prompts for two sets of meshes: those from which to subtract, and those to subtract. Once it has those, it joins each set, and then performs a boolean difference on the joined pieces.

I could post an .rvb file containing these, but it might be nice to get a little familiar with how to enter scripts yourself, so find the RhinoScript editor, paste the two scripts into it, and save it as an .rvb file somewhere on your system. Whenever this .rvb is loaded, you will have two script commands available (named for the subs in the code):
  • MeshFacesFromNurbsObjects
  • JoinAndDifferenceMeshFaces
You can then create a toolbar button for calling these, where the left- and right-button commands might be written like this:
  • -RunScript (MeshFacesFromNurbsObjects)
  • -RunScript (JoinAndDifferenceMeshFaces)
Hopefully this gives you an idea how to get where you want to be.
Sketchup 2025 Released

Thank you Fernando!!!!!!!!!!!!!!!!!!!!!!!!!!! hwol[…]

I've noticed that "export all" creates l[…]

hmmm can you elaborate a bit about the the use of […]

render engines and Maxwell

Funny, I think, that when I check CG sites they ar[…]