sketchucation logo sketchucation
    • Login
    1. Home
    2. riteshrpatil
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    R
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 6
    • Groups 1

    Posts

    Recent Best Controversial
    • Face Dimensions

      I am having problems getting the length and breadth of a rectangular face in SketchUp. I am using this code:` def height
      fheight = 0
      bb = self.bounds

      	if bb.depth != 0
      		fheight = bb.depth
      	else
      		fheight = bb.height
      	end
      	
      	return fheight.to_m
      end
      
      	# Method to return the width of a face in m
      def width
      	fwidth = 0
      	bb = self.bounds
      
      	if bb.depth != 0
      		fwidth = Math.sqrt((bb.width)**2 + (bb.height)**2)
      	else
      		fwidth = bb.width
      	end
      	
      	return fwidth.to_m
      end`
      

      But I am not getting the correct dimensions of the red rectangular face in attached screenshots.


      untitled1.jpg

      posted in Developers' Forum
      R
      riteshrpatil
    • RE: Face orientation

      I finally managed to get what I wanted after little playing on the code which you sent... My working code is as follows.

      	def azimuth
      		normal = self.normal
      
      		return 0 if normal.x == 0 and normal.y == 0
      
      		normal.z = 0
      		angle = normal.angle_between(Geom;;Vector3d.new(0,-1,0)).radians
      		angle = 360-angle if normal.x < 0
      
      		return angle +90
      	end
      
      
      posted in Developers' Forum
      R
      riteshrpatil
    • RE: Face orientation

      I make my question more clear.

      The green line/axis in Sketchup leads towards North direction from the origin. Now you can see the model as shown in the attached image. The wall which is marked as 'Wall 1' will have orientation of 90 degrees as it is perpendicular to the green axis. The wall which is marked as 'Wall 2' will have orientation of 180 degrees as it is parallel to the green axis. Similarly the wall exactly opposite to the 'Wall 1' will have orientation 270 degrees.

      Now my question is: How can I achieve '90' for 'Wall 1' and '180' for 'Wall 2' and so on?


      Sketchup Model

      posted in Developers' Forum
      R
      riteshrpatil
    • RE: Face orientation

      I mean the global North direction... suppose I have a simple model in SketchUp (having 4 walls one roof and one floor) and I want to know the orientation of the walls and roof.

      posted in Developers' Forum
      R
      riteshrpatil
    • RE: Face orientation

      Thank you for that reply and piece of code too... I will implement it in sometime and let you know if that it is what I want! 😄

      posted in Developers' Forum
      R
      riteshrpatil
    • Face orientation

      Hello,

      I am new to Ruby-Sketchup plugins. I am creating a plugin which gives me the geometry of the model in Sketchup. So far I have managed to get the area, texture of all the faces in a particular model - export it to a text file. But I also want get the orientation of all the faces in the model. When I say the word 'Orientation' I mean to get the direction of every face relative to the N direction, i.e with the Axes in Sketchup. If this is possible then I can manipulate it further.

      Can anyone come up with a solution or a hint?

      Thanking in anticipation...

      posted in Developers' Forum
      R
      riteshrpatil
    • 1 / 1