[Plugin] Simple Glazing tool

[Plugin] Simple Glazing tool

Postby tomot » Sun Aug 17, 2008 11:39 pm

Here is a simple gazing tool I created for a project which had a lot of frame less windows. and glass railings. I hope you find it useful.

I used the "pick 3 points rectangle" approach to install the glazing into any opening
be it horizontal, vertical or sloped orientation.

However I have not been able to find a way to set the Glazing back from the face of the
opening. Perhaps someone can help me with the required code to get this option working.
0

tomot 
PluginStore Author
PluginStore Author
 

Re: Simple Glazing tool

Postby juju » Mon Aug 18, 2008 8:45 am

Welcome to the SCF tomot and thanks for the contribution. Any further info / pics on this?
0
Save the Earth, it's the only planet with chocolate.
User avatar
juju 
Premium Member
Premium Member
 

Re: Simple Glazing tool

Postby tomot » Wed Aug 20, 2008 8:21 pm

I see no ruby gurus willing to take a nibble yet? :)

Once the rectangle has been picked, its co-ordinates are defined
by $pt0 thru $pt3 (see below)

#------create a new set of points from the original 3 point pick
$pt0=Geom::Point3d.new($pts[0][0], $pts[0][1], $pts[0][2])
$pt1=Geom::Point3d.new($pts[1][0], $pts[1][1], $pts[1][2])
$pt2=Geom::Point3d.new($pts[2][0], $pts[2][1], $pts[2][2])
$pt3=Geom::Point3d.new($pts[3][0], $pts[3][1], $pts[3][2])

I can then create the required code that makes the glazing,
give it a transparent color, followed by "pushpull'ing" the thickness of the glass
whose value is $ggthick (see below)

#------create the Glazing
group=entities.add_group
entities=group.entities
base=entities.add_face($pt0, $pt1, $pt2, $pt3)
base.material=Sketchup::Color.new(163,204,204) #change the RGB Color numbers here
base.material.alpha = 0.6
base.pushpull $ggthick

All of the above will produce glazing in any plane xy, xz, yz.

However in order to set the glazing back from an xy plane, I need a z offset
equally for glazing on an xz plane needs a y offset, and for glazing on an yz plane
requires an x offset.

If I was producing a static glazing ruby where the glazing was always located at 0,0,0
then I could provide the offset option via $wwthick which is the "Glass Setback from face value.
as follows:

$pt3=Geom::Point3d.new($pts[3][0], $pts[3][1], $pts[3][2]-$wwthick)
but this will not work for the other 2 planes.


Is there a 3d point in Ruby that is not tied to the world co-ordinate system, but rather
to a local co-ordinate system?

or is there a way to do a double pushpull one for the offset and one for the glazing thickness,
and then erasing the first sheet of glass?

TIA!
0

tomot 
PluginStore Author
PluginStore Author
 

Re: Simple Glazing tool

Postby Jim » Wed Aug 20, 2008 9:01 pm

Is there a 3d point in Ruby that is not tied to the world co-ordinate system, but rather
to a local co-ordinate system?


Entities added to a group are relative to the Group's origin and axes.
0
Hi

Jim 
Global Moderator
 

Re: Simple Glazing tool

Postby tomot » Wed Aug 20, 2008 10:25 pm

Jim I don't know what I'm going to do with that piece of information
in a practical way to solve this problem.

As the attached pic shows, at present the glazing is flush with each face
of the 2 opening the glazing is installed into.
I would like to have the option of letting the user pick an offset back from
the face as is shown in the opening on the left side of the cube.
0

tomot 
PluginStore Author
PluginStore Author
 

Re: Simple Glazing tool

Postby Jim » Wed Aug 20, 2008 10:30 pm

Well, you know the normal of the glass, just move the group forward or backward along the normal.

In other words, apply a transformation to the final group in the + or - direction along the base face normal.
0
Hi

Jim 
Global Moderator
 

Re: Simple Glazing tool

Postby TIG » Thu Aug 21, 2008 3:26 pm

Aren't you re-inventing Windowizer without a frame ? Currently you must enter something, but 0.1mm makes the frames effectively nothing...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Simple Glazing tool

Postby dtrarch » Thu Aug 21, 2008 3:50 pm

tomot

Very clever tool and thanks.
As it creates a group it is very easy to move back and forth.
Good enough as it stands.

dtr
0

dtrarch 
Premium Member
Premium Member
 

Re: Simple Glazing tool

Postby tomot » Fri Aug 22, 2008 4:11 am

TIG wrote:Aren't you re-inventing Windowizer without a frame ? Currently you must enter something, but 0.1mm makes the frames effectively nothing...


Not at all! Windowizer asks for 4 sided face to be selected first. While I use the "pick 3 point rectangle" method.
This is not a criticism of how Windowizer works, it has more to do with my workflow.
I design structures in SU using walls and slabs that have thickness. Then I punch openings in them for windows, doors, stairs etc., later I fill in those openings with the required components.

I find the "pick 3 points rectangle' method the most natural way to fill in an opening. If I were to use Windowizer, I have to fill in the opening prior to running the script.

However, I would be more interested in getting the setback problem solved.
While Jim's comments make a lot of sense, I can't get the code to work.

aargh!
0

tomot 
PluginStore Author
PluginStore Author
 

Re: Simple Glazing tool

Postby tomot » Fri Aug 22, 2008 4:19 am

dtrarch wrote:tomot

Very clever tool and thanks.
As it creates a group it is very easy to move back and forth.
Good enough as it stands.

dtr


Thanks! But after I have moved about 30 windows back 3" from the face. I
feel like my Grey matter is leaving for greener pastures.
0

tomot 
PluginStore Author
PluginStore Author
 

Re: Simple Glazing tool

Postby Jim » Fri Aug 22, 2008 10:34 am

Hi tomot,

Here is a snippet of your plugin with the transformation.

Code: Select all

    base.pushpull $ggthick
    self.reset
    normal = base.normal
    normal.length = 2 # how far?
    tr = Geom::Transformation.translation(normal.reverse)
    group.transform! tr
    model.commit_operation
end

0
Hi

Jim 
Global Moderator
 

Re: Simple Glazing tool

Postby tomot » Fri Aug 22, 2008 7:59 pm

Jim, please accept my great appreciation, with a reply HUG!

so here is the the attached update:
0

tomot 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Simple Glazing tool

Postby nomeradona » Tue Aug 26, 2008 5:30 am

clever and useful indeed.. thanks
0

nomeradona 
 

Re: [Plugin] Simple Glazing tool

Postby Fletch » Fri Sep 05, 2008 5:59 am

I asked a long time ago for windowizer to have ability to have "0" as the frame, and have it be left out completely... but all I remember getting was a "good idea Fletch"... while never seeing it implemented... I'm still waiting.

until then... this could be useful - thanks for sharing!... and true about the workflow... sometime nice to just draw interactively.
0

Fletch 
Twilight Render
 

Re: [Plugin] Simple Glazing tool

Postby RickW » Fri Sep 05, 2008 7:39 am

@fletch: Yeah, unfortunately, that happens a lot more than I would like. More ideas than time to implement...
0

RickW 
 

Re: [Plugin] Simple Glazing tool

Postby JGA » Mon Sep 08, 2008 1:50 pm

Tomat, thanks very much for the tool.
RickW, Windowizer is one of the most useful tools available. However, could it be adapted to provide an inner frame of a window? I currently push pull through the wall, repair the faces & then use windowizer on both sides of the wall.
0

JGA 
 

Re: [Plugin] Simple Glazing tool

Postby tomot » Tue Sep 09, 2008 5:04 pm

JGA wrote: However, could it be adapted to provide an inner frame of a window?


Yes I have a working copy, with glazing, frame and exterior trim however, I still have
a few bugs to resolve, before posting it.
0

tomot 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Simple Glazing tool

Postby Fletch » Thu Sep 18, 2008 4:28 pm

@Rick,
ah well... c'est la vie... :D
0

Fletch 
Twilight Render
 

Re: [Plugin] Simple Glazing tool

Postby tomot » Thu Sep 18, 2008 5:18 pm

Fletch wrote:@Rick,
ah well... c'est la vie... :D


In fairness to RickW, he has produced some amazing code.
I think he was the first one to create a dialog box in Ruby.
Without which all input Rubies could not exist.
0

tomot 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: linkph, roltsi89 and 12 guests

Visit our sponsors: