Tag: 素描

Sketchup API使用给定路径获取图像的宽度和高度

我需要用给定的路径获得图像的宽度和高度。 这是我的详细代码 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 […]

用于辐射计算的着色掩模算法

我正在研究一种软件(Ruby-Sketchup)来计算行人层面城市发展中的辐射(太阳,天空和周围建筑物)。 最终目标是能够创建一个显示总辐射水平的等高线图。 总辐射是指短波(光)和长波(热)。 (为了给你一个想法: http : //www.iaacblog.com/maa2011-2012-digitaltools/files/2012/01/Insolation-Analysis-All-Year.jpg ) 我知道有几个现有的软件可以做到这一点,但我需要自己编写,因为这个计算只是更复杂的工作流程的一部分。 (明显的)伪代码如下: Select and mesh surface for analysis From each point of the mesh Cast n (see below) rays in the upper hemisphere (precalculated) For each ray check whether it is in shade If in shade => Extract properties from intersected surface If not in shade => […]