[plugin] Divide By Material

[plugin] Divide By Material

Postby sdmitch » Thu Jun 02, 2011 7:53 pm

This plugin was created at the request of srx who, because of rendering requirements, needed to sub-divide faces with a given material. The plugin works with a selected subset or all faces in the model with the material selected from a list of all materials present in the model. The maximum size to the sub-division is also entered. The actual size is calculated based on the dimensions of the face. The faces are assumed to be rectangular. Faces inside groups and components are accessed and processed by the plugin.
0
Last edited by sdmitch on Mon Jun 06, 2011 4:01 pm, edited 2 times in total.
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin] Divide By Material

Postby Gaieus » Fri Jun 03, 2011 1:58 am

:thumb:

Thanks again, Sam!
0
User avatar
Gaieus 
 

Re: [plugin] Divide By Material

Postby srx » Fri Jun 03, 2011 9:49 am

:enlight:
Thank you Sam. I am glad for being part of this modest contribution to SC forum to which I own so much.
0
User avatar
srx 
 

Re: [plugin] Divide By Material

Postby Didier Bur » Fri Jun 03, 2011 10:01 am

Hi,
The script doesn't do anything here, no subdivision, no material paint :shock:
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [plugin] Divide By Material

Postby srx » Fri Jun 03, 2011 12:10 pm

First select geometry (not groups) with different materials applied.
Run plugin and chose the material which you want to subdivide and the maximum size of subdivision...and
It works for me...
but only for geometry not in groups or components .
Guess the next step is to make it work for all nested geometry :)
0
User avatar
srx 
 

Re: [plugin] Divide By Material

Postby sdmitch » Fri Jun 03, 2011 4:35 pm

srx, Glad that the plugin works for you. The plugin posted to this forum doesn't require you to pre-select the faces. If there are no selected faces, it looks at all faces in the model and sub-divides the ones with the given material.

As far as groups and components go, you can sub-divide their faces if you enter edit mode before running the plugin. This selects the faces and makes them accessable.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin] Divide By Material

Postby Didier Bur » Fri Jun 03, 2011 5:05 pm

Works on my PC at home (Win 7 SU8 Pro) but doesn't work at my office (WinXP SU8 Pro).
Would it be possible to have the localized material names instead of english names ?
0
Didier Bur (Bytes Farmer)
Ecole Nationale Supérieure d'Architecture de Nancy (F)
http://rld.crai.archi.fr/rubylibrarydepot/
User avatar
Didier Bur 
 

Re: [plugin] Divide By Material

Postby srx » Sat Jun 04, 2011 6:49 am

As far as groups and components go, you can sub-divide their faces if you enter edit mode before running the plugin.

This means that I have to enter every group - component in model manual?
Is it a problem to make it work for all nested geometry in model? This would be even more useful :)
0
User avatar
srx 
 

Re: [plugin] Divide By Material

Postby sdmitch » Sun Jun 05, 2011 6:46 pm

srx, Your wish is granted. DivideByMaterial.rb now handels faces in groups and components.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin] Divide By Material

Postby EarthMover » Sun Jun 05, 2011 8:41 pm

Nice work Sam. :thumb: Thanks for the update. Perhaps update the first post as well.
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [plugin] Divide By Material

Postby srx » Mon Jun 06, 2011 5:47 am

:D
:oops:
Thank you Sam. Very kind of you.
I agree you should update the first post.
0
User avatar
srx 
 

Re: [plugin] Divide By Material

Postby ZFRPS » Tue Jun 07, 2011 7:35 am

nice!
Thank you Sam ![img][url][/url][/img]
0
sketchup is bim

ZFRPS 
 

Re: [plugin] Divide By Material

Postby Daryan » Sun Dec 15, 2013 4:11 pm

"undefined method `file_loaded?' for main:Object"
0

Daryan 
 

Re: [plugin] Divide By Material

Postby Dave R » Sun Dec 15, 2013 4:16 pm

Daryan wrote:"undefined method `file_loaded?' for main:Object"



Very probably it's an install error but since we don't know anything whatsoever about your SketchUp version, operating system, nor how you went about installing the plugin, there's not much help to be given. Please complete your profile and help us help you.
0
Inspecting mirrors is a job I could easily see myself doing.

If you are the smartest person in the room, you are in the wrong room.
User avatar
Dave R 
Global Moderator
 

Re: [plugin] Divide By Material

Postby Daryan » Sun Dec 15, 2013 5:34 pm

Sorry, your right. Because im very bad in english i usualy say the less possible.

Windows 8.1
Sketchup 8 pro

install the plugin : just copy past the file "DivideByMaterial.rb" in C:\Program Files (x86)\Google\Google SketchUp 8\Plugins
0

Daryan 
 

Re: [plugin] Divide By Material

Postby TIG » Sun Dec 15, 2013 10:00 pm

The file is missing a line at its start:
require("sketchup.rb")
This is not needed IF an earlier loaded script has already required/loaded sketchup.rb...
But I suspect you do not have that happening...
Rather than edit the main file... Add this new file to your Plugins folder...
!.rb

On a restart of SketchUp any scripts missing the 'require("sketchup.rb")' should be OK because the !.rb files loads very early and will have done that for them...
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [plugin] Divide By Material

Postby Daryan » Mon Dec 16, 2013 12:49 am

Thanks a lot TIG !
0

Daryan 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: Jick, PRLau, Yahoo Bot and 11 guests

Visit our sponsors: