[Plugin] Perpendicular Face Tools (UPDATED 26-03-09)

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby Chris Fullmer » Sun Mar 15, 2009 9:24 am

Very Interesting. I have that plugin installed with no conflicts. I'll dig around tomorrow and see what I can find. Sorry for the inconvenience,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby MALAISE » Sun Mar 15, 2009 10:13 am

Thanks for playing attention, no matter for inconvenience, don't worry :)
MALAISE
0
La Connaissance n'a de valeur que partagée
User avatar
MALAISE 
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby Jim » Sun Mar 15, 2009 2:18 pm

MALAISE wrote:Hi ALL

Filtering the last downloaded plugins, I've found a conflict with Jim's cd_power_n.rb ( mover2.rb) Has someone experienced that? several times tested.

( SU V7, Windows XP SP3 )

MALAISE :?:


Mover2 does not use a file or method named cd_power_n.rb.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby Chris Fullmer » Sun Mar 15, 2009 4:55 pm

I know, its cad_fathers's SCF powertools toolbar plugin that wrapped mover2 into a file called cd_power_n.rb. If you open that file, its just your script. So I'm guessing it has something to do with how its being loaded from his main plugin loader maybe? I don't know. I know I've got my whole script wrapped in a class so I thought I should not have conflicts. But perhaps there is more to it than that.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby TIG » Mon Mar 16, 2009 10:37 am

I'm not getting bug-splats with custom-face, BUT it does inconveniently make a group of the selected face and not explode it at the end. It's easily fixed by adding a line of code after line #299, to explode the temporary group...
Code: Select all
@group.explode

How's the orienting face rotation on end of line going ?
.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby MALAISE » Mon Mar 16, 2009 2:51 pm

I've tried this improvement, the group is still present, not exploded. :?:

MALAISE
0
La Connaissance n'a de valeur que partagée
User avatar
MALAISE 
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby Chris Fullmer » Mon Mar 16, 2009 4:54 pm

Hey Tig, I probably could explode the group without any conflicts. I was thinking I didn't want the added face to interefere with the model, but its probably not an issue. Or maybe I explode it by default and have a ctrl key modifier that leaves it grouped. I've been wanting to figure out modifier keys.

As for the rotation thing, I still have not got it worked out :( I'm having a hard time pinpointing point C from my diagram above. I got close and it sort of worked, but it fell apart if the face was too slanted or something and I got so frustrated I have not even looked to figure out why. I'm sure its a million times easier than I'm making it. Since I can't find "C" yet, I intersected a flat plane with the face plane to get an intersection vector. That vector is the vector that I want my top(or bottom) edge to exist on. So I then did an angle_between the 2 vectors (the found one and the existing edge one) to get the angle that I want to rotate the face. That seemed to work in testing, but did not work well once I put it in the script. Sorry to drag this out. I'll probably put some more time into it today since I got a few other scripts updated last night.

@Malaise, I think maybe that added the ungroup function to the custom face tool only, and maybe you tested it on one of the other tools. It would need to be added for each tool. I'll look into it, and maybe even get it implemented sometime this century :)

Thanks everyone, thanks TIG!

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby TIG » Tue Mar 17, 2009 10:26 am

It's the original face that needs to be un-grouped. I agree that the face put on the end of the line is best left grouped to allow you to move its origin or rotate it about the line etc - you can explode it before doing a followme etc...

Here's my thinking on the rotation conundrum...

Let's do the square for now - seems to me that first you make a group containing a 'flat' square with its centre set at the origin and then move it to the select vertex at the end of the edge, transform rotating it so its face is perpendicular to the picked-vertex's edge... So far so good. Now we check the geometry of the square - it only has four vertices, so find the two with the lowest Z-value***. These are the vertices of the bottom-most edge. Now find the mid-point between them - we use this to work out the vector from the 'centre' (picked-vertex's location) to this mid-point and the angle between that and a 'vertical' vector in the same plane as the face: that 'angle' is the angle that we'll use later on to rotate everything so that it is 'orthogonal' to the XYZ axes.

Let's call the centre 'c' and two lowest points 'p1' and 'p2' - these are known - and the mid-point we'll call 'm' - that we need to get...
To find a point mid-way between two others use...
Code: Select all
 m = Geom::Point3d.linear_combination(0.5,p1,0.5,p2)

We can then get the vector from 'c' to 'm', let's call it 'cm' - simply subtract the point values...
Code: Select all
 cm = c - m

Now to find the 'vertical vector' (let's call it 'vv') - first find a point ('t') 1 unit away from 'c' above the surface of the face by the edge's [positive] 'vector' and then project it down till it hits the face at 'v' - the line between 'c' and 'v' is the 'vertical vector' against which we'll rotate the face...
Code: Select all
 t = c.offset(vector,1)
 ang = (t-c).angle_between(t-[0,0,-1]) # i.e. the tilt on face normal
 hyp = 1/Math::cos(ang) # i.e. the drop from t to face plane
 h = [t.x,t.y,(t.z)-hyp] # i.e. the point t projected onto the face's plane
 vv = c-h # the vertical vector

Now get it's angle to the 'mid-point vector'
Code: Select all
 angle = vv.angle_between(cm)

You then need to work on the face of the square and transform/rotate the whole thing around the picked-vertex's edge by the 'angle'... Done.

***Note: IF the Z of all of the square's vertices is the same [simple test to look at the four] then it's 'flat' so then we'll find the lowest two Ys and rotate it to be orthogonal about the Z axis instead. Also note that in this 'flat' case the 'vertical' vector needs to be (0,-1,0) to match the Y...

For the custom face do something similar but group the face, copy it, explode the original back to where it was and then use the copy's bounding box centre as its 'origin', move and transform it to the vertex, use the new location's bounds to get an enclosing rectangle to get minimum Zs etc, all as above etc etc...

I haven't tried this code, but it should at least form the basis of something that''ll work...

.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby Chris Fullmer » Tue Mar 17, 2009 7:44 pm

Thanks for walking me through this TIG. Hopefully I'll get a chance to try to get this implemented tonight or tomorrow. Lots of work-work and school-work today :(

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby cosycat » Tue Mar 17, 2009 10:19 pm

looking at this, I wondered how difficult it would be to create a script that 'blended' between two diffrent faces at either end of a line.
0

cosycat 
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby Chris Fullmer » Tue Mar 17, 2009 11:40 pm

Unfortunately, it would be very difficult - for me! I have thought similar thoughts, and that is a plugin that is on my wishlist. I am working on anther ruby that begins to get into that arena of morphing from one shape to another, but it is really new territory for me. Maybe in time :)

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby xrok1 » Tue Mar 17, 2009 11:52 pm

cosycat wrote:looking at this, I wondered how difficult it would be to create a script that 'blended' between two diffrent faces at either end of a line.

Like this?
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby thomthom » Wed Mar 18, 2009 12:01 am

Not like that. That simply scales the shape. They are talking about morphing for instance a circle shape to a star shape.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby xrok1 » Wed Mar 18, 2009 12:05 am

that would be a loft wouldn't it?
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: [Plugin] Perpendicular Face Tools v0.1 beta

Postby pilou » Wed Mar 18, 2009 1:35 am

In Nurbs language it's more kown as a sweep :)
sweep.jpg
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby Chris Fullmer » Wed Mar 25, 2009 8:17 am

WOOHOO!!! I finally got it. Little by little I"m understanding transformations....after getting TONS of help from TIG on this script, and Fredo and pretty much everyone else. So I'm pleased to announce the updates to this script:

Perpendicular Face Tools
Description: Three Perpendicular Face tools to help create faces perpendicular to the end of lines.
Usage: Activate it at Plugins>Chris Fullmer Tools>Perpendicular Line Tools. Change the size of squares by entering a new dimension into the measuerments box after the face has been created. Change the radius of circles by entering "12s" for 12 sides into the measurements box. To use the custom face tool, create your face flat on the groundplane. The script attempts to line up the x axis as the bottom edge of the face.


v1.0 Updates:
* The original face now explodes upon exiting the custom face tool.
* Added support so that faces will stay oriented with a flat edge on the horizontal plane.
* Holding ctrl while creating a face will over-ride the flat horizontal feature and revert back to the default SketchUp "Arbitrary Rotation".
* Now faces can be added anywhere to a line - on the endpoint (existing feature), in the middle of a line, or on a vertex of 2 lines. The vertex of 3 lines is not supported.

I think that is everything that was requested on this script and more. Faces now orient better, the custom face gets exploded on exiting the tool, AND being able to add perpendicular faces to a single edge, an endpoint and the vertices of 2 lines. Please let me know if there are bugs. Its quite possible. I've tried to test it thoroughly, but its always possible I've missed something :)

Hope it helps,

Chris

PS. I think I'll do some icons for this tomorrow. Also, the video is not updated yet on the front page. I'm too tied to do it right now. I'll do it tomorrow.
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby Chris Fullmer » Wed Mar 25, 2009 6:00 pm

I found a little bug where the custom face needs to be drawn with the back face pointing upwards. I'll try to fix that shortly so the face can be facing either way.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby wolfy » Wed Mar 25, 2009 8:54 pm

Chris, thank you so much for this, as well as other, wonderful scripts. Your expertise is highly appreciated!! :enlight:
0

wolfy 
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby Chris Fullmer » Wed Mar 25, 2009 9:13 pm

Thanks! I'm currently sitting at my computer pulling my hair out though because I can't make the custom face tool work more solidly......grrr. If I draw it, and then run the script, it normally works. But if I reverse it, its borken. OR sometimes just moving it or making a copy of it and using the copy is enough to make my script not orient it correctly. I've still got some ideas to fix it so no matter what you do it, it will orient itself uniformly. I'll get it. Once I do, I'll upload a new version. I've even got a great toolbar for the new update.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby ken » Wed Mar 25, 2009 9:19 pm

Chris

Thanks for the update. However, now I have two Chris Fullmer Menu in my plugins. Is that what you intended?

#1
Scale and Rotate
Component on Faces
Select Lines by Lenght

The other:
#2
Perpendicular Face Tool
3 Line Tool

Thanks for all your work

Ken
0
Fight like your the third monkey on Noah's Ark gangway.
User avatar
ken 
Premium Member
Premium Member
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby Chris Fullmer » Wed Mar 25, 2009 9:25 pm

Hmm, that is not at all what I intended. I'll check to see if I messed up my menu system somehow. Thanks for letting me know,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby jeff hammond » Wed Mar 25, 2009 9:28 pm

sweet
thank you!
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby jeff hammond » Wed Mar 25, 2009 10:47 pm

1 thing, (and this is more/less for discussion because i'm well aware i might be in the minority)

with the perp.circle, would you rather have the vertex of the segments at the top -or- one of the segments being horizontal (the way it's working now).

personally, i think it would be better if the vertex were at the top so diameter/radius lines can be drawn vertically or horizontally..

(am i even making any sense? :) )


that aside, i really like the change to perp.square.. having the horizontal edge is great.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby putnik » Thu Mar 26, 2009 12:13 am

having the horizontal edge is great.

+1. Thank you, Chris.
0

putnik 
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby jeff hammond » Thu Mar 26, 2009 1:06 am

for example... drawing something like this:

screenshot 2.jpg



would be 3 or 4 steps faster if the vertex of the circle were up top instead of the segment.. regardless of that part though, this script is way better than having to manually draw the perpendicular plane to begin with..
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools (UPDATED AGAIN 3-25-09)

Postby Chris Fullmer » Thu Mar 26, 2009 2:06 am

ok, I have updated it again. This time it has a toolbar:

per_faces_toolbar.jpg


I've also attempted to fix some serious issues with the custom face tool and how it orients itself. Unfortunately, its still only about 99% right. There are times when the custom face tool will not orient the face as expected. Often when used on a line that perfectly on the y axis. I'm sure its just a bug in how I'm rotating. But I've looked at the code too long and its really messy. So maybe later I'll re-write it from scratch to clean it up.

As for rotating so that a point is always up.....I'm listening. I don't quite get the benefit by the example you showed though. I generally like to draw through circles on the mid point of edges, not on the vertices. But I might be the only one. So do you have another example that shows how it would be useful to do it with a vertice always on top?

I also updated the video on the front page.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby xrok1 » Thu Mar 26, 2009 2:33 am

Jeff Hammond wrote:1 thing, (and this is more/less for discussion because i'm well aware i might be in the minority)

with the perp.circle, would you rather have the vertex of the segments at the top -or- one of the segments being horizontal (the way it's working now).

personally, i think it would be better if the vertex were at the top so diameter/radius lines can be drawn vertically or horizontally..

(am i even making any sense? :) )


that aside, i really like the change to perp.square.. having the horizontal edge is great.


if you type an uneven number of segments you will have a vert at the top. ;)
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: [Plugin] Perpendicular Face Tools (UPDATED AGAIN 3-25-09)

Postby jeff hammond » Thu Mar 26, 2009 2:34 am

Chris Fullmer wrote: So do you have another example that shows how it would be useful to do it with a vertice always on top?


this one:




they're both the same circle.. it's better (for me) to have the actual radius on a vert/horizontal.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools (UPDATED March 25, 2009)

Postby jeff hammond » Thu Mar 26, 2009 2:39 am

xrok1 wrote:if you type an uneven number of segments you will have a vert at the top. ;)

yeah, and that would work to an extent but then the horizontal is off.. i usually work off of 1/4 circles, get them to the right height, and then divide them into 8"o.c. segments.. it's just easier for me if everything is straight up&down / side-to-side at the beginning of the process.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] Perpendicular Face Tools (UPDATED AGAIN 3-25-09)

Postby xrok1 » Thu Mar 26, 2009 2:41 am

makes sense.
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot], gedis, Google Bot, ImUnaii, msj and 23 guests

Visit our sponsors: