How to find out edge softness?


#1

How to find out how much edge was softened? Entity info shows if it was softened or smoothed. But this does not tell me the value needed to replicated (the snow effect).

roof snow.skp (58.0 KB)


#2

Yeah, I have noticed this annoying trait on the Mac interface at least. While I can soften various objects to different degrees, selecting back into a previously softened object does not reset the slider in the soften/smooth window to reflect the values used on that a object. Whatever value or options were the last used in soften window continue to display. I do not know of a workaround for this, wish it was fixed.

Perhaps someone out there has a trick for reading to value of a previous soften, but I don’t know if it can be done.


#3

Here is a ruby script to make a ‘best guess’. Right-click on the group or component, and select 'Show Smoothing Angle’
Essentially each softened edge between two faces needs to be looked at, and then determine the angle between the two faces. If there is any manual intervention with edge smoothness, then this method wouldn’t help.

# Name :          ShowSmoothAngle 1.0
# Author :        Natty

require 'sketchup.rb'

class ShowSmoothAngle

  	def ShowSmoothAngle::ValidateEntity
		sel=Sketchup.active_model.selection
		if sel == nil
			return false
		end
		if sel.length != 1
			return false
		end
		if sel[0].class == Sketchup::Group
			return true
		end
		if sel[0].class == Sketchup::ComponentInstance
			return true
		end
		return false
	end
	
	def ShowSmoothAngle::GetAngle(group)
		angle = 0
		group.entities.each { |e|
			if e.class == Sketchup::Edge
				if e.smooth?
					if e.faces.length == 2
						normal1 = e.faces[0].normal
						normal2 = e.faces[1].normal
						a = normal1.angle_between normal2
						puts a.to_s
						if a > angle
							angle = a
						end
					end
				end
			end
		}
		return angle
	end
	
	def ShowSmoothAngle::Execute()
		angle = 1000
		Sketchup.active_model.selection.each { |e|
			if e.class == Sketchup::Group
				puts "Group"
				angle = GetAngle(e)
			end
			if e.class == Sketchup::ComponentInstance
				puts "Component"
				angle = GetAngle(e.definition)
			end
		}
		angle = angle * 180.0 / 3.1415926
		UI.messagebox("Minimum smoothed angle: " + angle.to_s + " degrees")
	end
	
end # Class MoveBy

if(not file_loaded?("ShowSmoothAngle.rb"))
	UI.add_context_menu_handler do |menu|
		menu.add_item("Show Smoothing Angle") { ShowSmoothAngle.Execute() } if ShowSmoothAngle.ValidateEntity
	end
end
file_loaded("ShowSmoothAngle.rb")

#4

Edge softing is binary, either an edge is soften or it’s not soften, there are no different levels of softing for one single edge. Same goes for smoothing,

However, as Centaurs says, it is possible to find the sharpest soften edge to estimate the angle that was entered in the Soften Edges pane.


#5

You have the makings of a handy little extension there.


#6

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.