sketchup

Problems rendering a Polar Zonohedron in Processing

余生颓废 提交于 2020-01-14 14:13:33
问题 I've recently been looking into Zonohedrons and Rob Bell made beautiful ones. I had a play with the free Polar Zonohedron Sketchup Plugin and thought about playing with the geometry using Processing. So far I've open up the plugin/Ruby script and tried to port it directly, but I am not experienced with Ruby and have been using the Sketchup Ruby API reference. The geometry part of the code is mostly in the polar_zonohedron function: def polar_zonohedron #frequency, pitch = atan(sqrt(2)/2), len

Detecting Operating Systems in Ruby [duplicate]

我与影子孤独终老i 提交于 2020-01-09 04:39:50
问题 This question already has answers here : How can I find which operating system my Ruby program is running on? (10 answers) Closed 5 years ago . Is there a way to detect the operating system in ruby? I am working on developing a sketchup tool that will need to detect Mac vs. Windows. 回答1: You can use the os gem: gem install os And then require 'os' OS.linux? #=> true or false OS.windows? #=> true or false OS.java? #=> true or false OS.bsd? #=> true or false OS.mac? #=> true or false # and so

Detecting Operating Systems in Ruby [duplicate]

最后都变了- 提交于 2020-01-09 04:39:07
问题 This question already has answers here : How can I find which operating system my Ruby program is running on? (10 answers) Closed 5 years ago . Is there a way to detect the operating system in ruby? I am working on developing a sketchup tool that will need to detect Mac vs. Windows. 回答1: You can use the os gem: gem install os And then require 'os' OS.linux? #=> true or false OS.windows? #=> true or false OS.java? #=> true or false OS.bsd? #=> true or false OS.mac? #=> true or false # and so

How to count duplicates hash itens in Ruby 1.8.5 ( Sketchup Ruby API )

喜你入骨 提交于 2019-12-30 13:37:31
问题 I need to count the duplicates, they need to be 100% identical to increase my count, but I can not use a nothing out of Ruby 1.8.5, this code will run inside a plugin in google sketchup Google Sketchup Ruby API puts VERSION 1.8.5 puts RUBY_PLATFORM i686-darwin8.10.1 product = 'Glass' x = width y = length z = density product_list = [ { "product" => 1, "x" => 200, "y" => 100, "z" => 18}, { "product" => 1, "x" => 200, "y" => 100, "z" => 18}, { "product" => 1, "x" => 300, "y" => 100, "z" => 18},

SketchUp export obj with textures - how

孤者浪人 提交于 2019-12-22 14:16:43
问题 Windows 7 (64bit), SketchUp Make 13.0.4812. Goal: convert SketchUp .skp model to .obj and load to WebGL using three.js. Problem: sketchup exports model to .obj with external textures, and these textures are not loaded by three.js. Question: is it possible to save SketchUp model as one .obj file with textures? 回答1: No, .obj is a simple text format. You can't store textures in .obj. Here is an example on how to load the texture from a separate .jpg file. I copied the important bits: // texture

Shading mask algorithm for radiation calculations

帅比萌擦擦* 提交于 2019-12-19 10:52:22
问题 I am working on a software (Ruby - Sketchup) to calculate the radiation (sun, sky and surrounding buildings) within urban development at pedestrian level. The final goal is to be able to create a contour map that shows the level of total radiation. With total radiation I mean shortwave (light) and longwave(heat). (To give you an idea: http://www.iaacblog.com/maa2011-2012-digitaltools/files/2012/01/Insolation-Analysis-All-Year.jpg) I know there are several existing software that do this, but I

Google SketchUp close file

两盒软妹~` 提交于 2019-12-14 02:22:36
问题 The Ruby API to Google SketchUp has a function, open_file , but I can't find a close_file function. Since I have to batch process many files, I want to close each file before moving on to the next, otherwise the program will crash from memory exhaustion. What is the best way to close SketchUp files programmatically? I am using Mac OS X and am willing to use AppleScript functions to signal the window to close. EDIT I am considering a few approaches that have proven fruitless so far. Using the

Sketchup API Get the width and height of image with given path

泪湿孤枕 提交于 2019-12-13 03:37:19
问题 I need to get width and height of image with given path. Here is my detail code path = UI.openpanel("Open Image File","/","*.jpg;*.png;*.jpeg") if(path != nil) #get the original width of image old_width = ?????? #get the original height of image old_height = ?????? #get the orginal rate of image rate = old_width.to_f / old_height_to_f #then import image into model as a Image entity point = Geom::Point3d.new 0,10,0 objImage = entities.add_image path, point , 318,318/rate end I need a way to

Converting Sketchup Transformation to Three.js rotation+scale+position or Matrix

拜拜、爱过 提交于 2019-12-11 23:18:10
问题 I'm writing an export script (ruby) in SketchUp, and I'm having trouble applying the same transformation in Three.js side, so that objects have the same rotation in Three.js as they appear in SketchUp. I can read the rotation using the SketchUp Transformation class: http://www.sketchup.com/intl/en/developer/docs/ourdoc/transformation.php I can get these kind of values from a rotated component that I pass to my Three.js code. All are Vectors in the form of X, Y, Z xaxis: 0.0157771536190692,-0

Assigned texture to glb model in Three.js is reversed and only working with THREE.RepeatWrapping

喜你入骨 提交于 2019-12-11 19:35:45
问题 I load a glb model in Three.js generated in SketchUp. The file can be found here https://www.graviditetsberegner.dk/bpnew.skp The model contains a group called text with a mesh. I want to display a texture containing text here. I use the below code: var modelLoader = new THREE.GLTFLoader(); modelLoader.load("https://www.graviditetsberegner.dk/bpnew.glb", function (gltf) { model = gltf.scene.clone(); model.scale.set(50,50,50) scene.add(model); //Use canvas to draw texture and add it to the