lib/su_info/Template_Code.rb
# An example showing use of the Face constants
#
An example showing use of the Face constants
An example showing use of the Face constants
def face_1
    cns = Sketchup::Face
    face = Sketchup.active_model.entities.grep(cns)[0]
    if (face)
      pt_location = face.classify_point(ORIGIN)
      t = case pt_location
        when cns::PointInside      then 'pt is inside'
        when cns::PointNotOnPlane  then 'pt not on plane'
        when cns::PointOnEdge,
             cns::PointOnVertex    then 'pt on perimeter'
        when cns::PointOutside     then 'pt is outside'
        when cns::PointUnknown     then 'pt error?'
        else 'not trapped by case statement'
      end
    else
      t = 'no face found'
    end
    puts t
  end
def face_1 cns = Sketchup :: Face face = Sketchup . active_model . entities . grep ( cns ) [ 0 ] if ( face ) pt_location = face . classify_point ( ORIGIN ) t = case pt_location when cns :: PointInside then 'pt is inside' when cns :: PointNotOnPlane then 'pt not on plane' when cns :: PointOnEdge , cns :: PointOnVertex then 'pt on perimeter' when cns :: PointOutside then 'pt is outside' when cns :: PointUnknown then 'pt error?' else 'not trapped by case statement' end else t = 'no face found' end puts t end
An example showing use of the Face constants
An example showing use of the Face constants
# must have a model open with at least one face!