sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Push multiple: extruded lenght proportional to face area

    Scheduled Pinned Locked Moved Plugins
    2 Posts 2 Posters 456 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • arnauA Offline
      arnau
      last edited by arnau

      Hey!

      I wonder if there is any plugin able to extrude multyple faces, where the extruded length of every single face should be proportional to his area.

      Any help?

      Thanks in advance:)

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        @arnau said:

        Hey!

        I wonder if there is any plugin able to extrude multyple faces, where the extruded length of every single face should be proportional to his area.

        Any help?

        Thanks in advance:)

        If not, this might do

        def extrude_by_area
        	mod = Sketchup.active_model # Open model
        	ent = mod.entities # All entities in model
        	sel = mod.selection # Current selection
        	@min_extru = '1'.to_l; @max_extru = '5'.to_l
        	ans = UI.inputbox(["Minimum Extrusion;","Maximum Extrusion;"],[@min_extru,@max_extru],"Extrude by Area")
        	if ans
        		sel.empty? ? ents = ent ; ents = sel
        		@min_extru,@max_extru=ans;min_area=1e9;max_area=-1e9
        		ents.grep(Sketchup;;Face).each{|f| min_area=[min_area,f.area].min;max_area=[max_area,f.area].max}
        		rng_area = max_area - min_area; rng_extru = @max_extru - @min_extru
        		ents.grep(Sketchup;;Face).each{|f| extru = (f.area-min_area)/rng_area*rng_extru+@min_extru; f.pushpull extru}
        	end
        end
        

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement