Dividing Up a Window Frame
-
Hi,
I work with a program for building analysis that imports simple SketchUp geometry (e.g buildings drawn with a single face to represent a wall).
The problem is the export tool struggles with window frames. The window can't be drawn as an island inside the frame or it will cause the export to fail.
The most effective work around is to add diagonal lines to break up the frame into simple pieces. See attached image.
The ruby script for the exporter is scrambled so it can't easily be altered. But I was wandering if there was a way to develop a script that creates the diagonal lines automatically.
I can think of two approaches:
-
Identify the glass window pane by its material (or manual selection) and move it perpendicular to the frame. This way SketchUp automatically generates the diagonal lines I require. And the pane can then be moved back.
-
Run a script that cycles through each vertex and checks for another vertex within a certain 'grab distance' (100mm sounds about right for most windows). A line could then be added between all vertices less than a certain distance apart and this should hopefully give the desired results.
I hope this gives a clear explanation of the problem and any help would be greatly appreciated.
Ross
-
-
My
SplitDonut
with split the ring face at the corners...
Note too thatSplitSausage
does the same for 'non-rings' - you need to 'seed' a short edge so the splits proceed as expected.To find 'rings' [faces with ONE hole] in a selection use a filter like:
m=Sketchup.active_model;s=m.selection;f=s.grep(Sketchup;;Face).find_all{|e|e.loops.length==2};s.clear;s.add(f);
You can then use
SplitDonut
on the selection en mass...
The command you could add to the end of the above code to automate things ism=Sketchup.active_model;s=m.selection;f=s.grep(Sketchup;;Face).find_all{|e|e.loops.length==2};s.clear;s.add(f);TIG.splitdonut();
To divide multi-holed faces you need to add a line to make one-hole 'rings' ...
Advertisement