[Plugin] Stick groups to mesh ver. 1.2.

[Plugin] Stick groups to mesh ver. 1.2.

Postby kirill2008 » Wed Dec 23, 2009 9:27 pm

mshstick.rb


Description:
Plug-in, which deforms selected group of faces to follow the selected surface

How to use:
1) put “mshstick.rb” to “Google SketchUp 6\Plugins” folder
2) start SketchUp 6
3) select some groups of faces, which you want to stick to another group of faces (surface mesh)
4) choose the command "Plugins>>Stick selected groups to mesh group" command from the main menu
5) pick the group with mesh, to which you are going to stick selected groups

ver. 1.0. demo video:


Known limitations:
- the current vesion (1.0) processes correctly only terrain-like* 'rulling' surface mesh group (* only one z for each x,y)
- ver. 1.0. has only vertical 'sticking' direction (script projects vertices of selected groups normaly to the XY plane)
- ver. 1.0. processes only geometry of selected groups (discards materials information)

ver. 1.1.
functions added:
- ability to choose stick direction added (only parallel to main axises yet)
- "Stick type" option added (allows to switch between "normal" and "super" stick type)
- ability to cancel process added (by hitting <Esc> key)
- ability to process almost any kind of ruling surface (solid-like surfaces are also supported now)

bug fixes:
- undo performance improved

ver. 1.1. demo videos (set of 4 ones):


ver. 1.2.
functions added:
- ability to specify free vector as stick ray direction (has not to deviate from preset direction much if stick type option is set to 'Normal')
- 'Skip edges projection stage' option added (it is useful if sticking group(s) has(have) enough dense mesh or it is necessary to leave the initial vertex count of sticking groups for some reason)
- 'Reflection ray' option added (refer to the video for more information)
- 'Offset value' adjustment value added (allows offset of sticked groups from the ruling surface)
- 'Magnify' adjustment value added (a kind of scale coefficient for 'reflection ray' vector length)

ver. 1.1. demo video:


known issues:
- groups transformations such as scale and rotate process still insufficiently (so it is necessary to explode 'em and regroup before sticking)
1
Last edited by kirill2008 on Sat Jan 02, 2010 9:41 pm, edited 4 times in total.

kirill2008 
PluginStore Author
PluginStore Author
 

Re: Stick groups to mesh ver. 1.0.

Postby Jim » Wed Dec 23, 2009 9:32 pm

Incredible! You've just made a lot of people very happy! Thanks for all your great work. :thumb:
0
Hi

Jim 
Global Moderator
 

Re: Stick groups to mesh ver. 1.0.

Postby mitcorb » Wed Dec 23, 2009 9:41 pm

There you go again! Unbelievable.
It is obvious you have a very good command of the Ruby language and the inner workings of Sketchup. Congratulations. I definitely will want to try this gem.
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: Stick groups to mesh ver. 1.0.

Postby EarthMover » Thu Dec 24, 2009 2:02 am

:o :o :o The possibilities!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :sketchstatic: :sketchstatic: Thanks for the amazing scripts you are writing.

I would like to see the possibility of "timing out" your scripts with the escape button like Fredo has in the Round corner plugin. Especially with the scripts that take a long time to process. It would be a big help.

It's amazing how you manage to allow the script to run while the user is still able to rotate and move around the scene. I think that's unique to your last two scripts.
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: Stick groups to mesh ver. 1.0.

Postby d12dozr » Thu Dec 24, 2009 5:41 am

I can foresee super-easy snow additions...Thanks, Kirill!
0
3D Printing with SketchUp Book
http://goo.gl/f7ooYh

d12dozr 
Top SketchUcator
 

Re: Stick groups to mesh ver. 1.0.

Postby Khai » Thu Dec 24, 2009 6:21 am

oh gods...
wiring, cables, armour plating..... :twisted:
0

Khai 
 

Re: Stick groups to mesh ver. 1.0.

Postby urgen » Thu Dec 24, 2009 8:17 am

....красивая работа Kирилл! :thumb: ...nice work! thanks! :D
0
--pupil forever...------
User avatar
urgen 
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby remus » Thu Dec 24, 2009 8:32 am

Its like super-drape :D
0

remus 
 

Re: Stick groups to mesh ver. 1.0.

Postby kirill2008 » Thu Dec 24, 2009 9:18 am

EarthMover wrote:I would like to see the possibility of "timing out" your scripts with the escape button like Fredo has in the Round corner plugin. Especially with the scripts that take a long time to process.

Yes I agree it is _necessary_ to add :thumb: . I think it's number 1 feature in my list of updates for all 'long-lasting' scripts.
EarthMover wrote:It's amazing how you manage to allow the script to run while the user is still able to rotate and move around the scene.

Actually it is not my achievment. It is already implemented ability of sketchup API (so called 'timer' works such a way). You know, as for me, I'm amazed at the sketchup itself
(as well as it's nicely documented API).
0

kirill2008 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby MALAISE » Thu Dec 24, 2009 9:47 am

Hi Kirill,

You've done a new incredible tool. Now making Dali's like watches will be very easy :D .
montres-molles-dali.jpg


Best Wishes for 2010

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

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby Rich O Brien » Thu Dec 24, 2009 10:26 am

This is a most welcome addition to your already impressive collection of plugins.

Thank you and merry Xmas and a happy new year to you
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby kirill2008 » Thu Dec 24, 2009 10:27 am

MALAISE wrote:Now making Dali's like watches will be very easy :D .

Well, actually the initial idea of the script was to stick some master plan elements (paving, roads, grass etc) to the terrain surface (
boring, isn't it?), but why not stick watches too?

I think it is necessary to make some enhancements to the script (materials support, optional sticking direction etc) to make it more flexible than just master plan elements 'sticker'.
0

kirill2008 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby mitcorb » Thu Dec 24, 2009 4:50 pm

Kirill:
Your openness to suggestions is a wonderful trait, which seems to be shared by all of the Ruby masters in this forum.

May you and all here have a joyous season!
mitcorb
0
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb 
Top SketchUcator
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby EscapeArtist » Thu Dec 24, 2009 8:51 pm

To sum up:

Dude, you rock! What a great plugin.

EDIT: I seem to find a way to break your plugins! Same as my comments about the "add control points" plugin, I applied the plugin, undid the action, and then tried to reapply it. Now I have the rapidly scrolling error messages in the Ruby window the don't stop, and a pop-up error dialog that says "It is necessary to select some groups of faces before calling the command".

Only fix is to restart SU.

Code: Select all
Error: #<TypeError: reference to deleted Group>
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `entities'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `deform_group'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:213:in `call'
(eval):892
Error: #<TypeError: reference to deleted Group>
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `entities'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `deform_group'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:213:in `call'
(eval):892
Error: #<TypeError: reference to deleted Group>
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `entities'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `deform_group'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:213:in `call'
(eval):892
Error: #<TypeError: reference to deleted Group>
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `entities'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `deform_group'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:213:in `call'
(eval):892
Error: #<TypeError: reference to deleted Group>
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `entities'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `deform_group'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:213:in `call'
(eval):892
Error: #<TypeError: reference to deleted Group>
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `entities'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:214:in `deform_group'
L:/Modeling/Sketchup Google/Plugins/ctrlpnts.rb:213:in `call'
(eval):892



PS: I love watching these scripts work, it's like watching Jeff Bridge's character get digitized in Tron.
0
User avatar
EscapeArtist 
Top SketchUcator
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby charly2008 » Thu Dec 24, 2009 11:55 pm

Hi Kirill,

What a great plugin. An incredible tool. But it doesn't work in Sketchup 7.

Karlheinz
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby Chris Fullmer » Fri Dec 25, 2009 5:58 am

Awesome Kirill, glad you wrote this. This script has been the "next script" on my list to do for a long time, and I have just never quite got around to figuring it out. Saved me a lot of headaches :)

Seriously, very cool script!

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] Stick groups to mesh ver. 1.0.

Postby kirill2008 » Fri Dec 25, 2009 7:45 am

EscapeArtist wrote:EDIT: I seem to find a way to break your plugins! Same as my comments about the "add control points" plugin, I applied the plugin, undid the action, and then tried to reapply it.

Undo performance correct handling is my headache
. I promiss to fix it.

EscapeArtist wrote:PS: I love watching these scripts work, it's like watching Jeff Bridge's character get digitized in Tron.

A kind of retro-futurism


UPD: I mean real-time sticking would look much more impressive, of course. Just imagine: you see neither '>' sign moving left-to-right, nor Jeff Bridge's digitizing characters after picking a surface, just _immediately_ sticked geometry group. It is possible for sure (and maybe already exist in some other modeling soft), but demands a bit low level coding, I guess.
I believe, SU developing team will take in account an interest of SU community and will add similar tool in future versions of SU (at least in pro version).

a bit off-topick: http://www.youtube.com/watch?v=jz8QWDBYn5w
0
Last edited by kirill2008 on Fri Dec 25, 2009 4:26 pm, edited 1 time in total.

kirill2008 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby kirill2008 » Fri Dec 25, 2009 8:08 am

Chris Fullmer wrote:Saved me a lot of headaches :)

I must say, that the most brain-damaging part was addition of edges projections of 'ruling' surface to the group
. Finaly I recalled, that sketchup API has the very powerful built-in method (it actually has a plenty of) for entities collection 'entities.intersect_with'. The rest part was more or less obvious.
So actually almost all 'housekeeping' details SU handles itself :thumb: .
0

kirill2008 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby pp1357pp24 » Fri Dec 25, 2009 2:20 pm

thank you,I need for my model
0

pp1357pp24 
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby jerome » Sat Dec 26, 2009 2:20 am

charly2008 wrote:Hi Kirill,

What a great plugin. An incredible tool. But it doesn't work in Sketchup 7.

Karlheinz


Dear charly2008
It's work fine in my sketchup 7.1.
0

jerome 
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby driven » Sat Dec 26, 2009 3:43 am

Merry Xmas, New Year, etc...

Kirril, works on OSX10.5.8 + 7.1, however, 3D text needs to be exploded and regrouped, and it seems to prefer, grid patches made with sandbox, or I get issues.

but that's fine because it is so neat (and I don't mean in the corny American way), it is tidy, precision engineering tidy, 3D stainless steel printing tidy, fantastic, I certainly hope Santa bought you something nice.

Anyway heres my test, on a torrus, with a material I made using blend(dot)rb, I'll put a You tube Texture anim up tomorrow. I want to make fire in sketchup... for some reason.

all the best

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby notareal » Sat Dec 26, 2009 10:33 am

:o Really cool plugin! Happy holidays!
0
Welcome to try Thea Render, Thea support | kerkythea.net -team member

notareal 
Thea Render Support
Thea Render Support
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby charly2008 » Sat Dec 26, 2009 1:16 pm

Hi Jerome,

You're right, it works. It was my fault. But I noticed the changing of the selection frame.

Karlheinz
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby fredo6 » Sat Dec 26, 2009 4:33 pm

Kirill,

The plugin seems very powerful, but I can't make it work on SU7.
The progress bar appears but seems to block (at 12%).
I am just trying to stick a cube on a dome.

Fredo
0
User avatar
fredo6 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby driven » Sat Dec 26, 2009 5:55 pm

Fredo,

I had to zero out smoothing on the recipient mesh first, and on some of the SU shapes, I also found using 'add-detail' from sandbox seemed to make a difference.

don't know why it worked, but I've been trying to apply 3D text to curved tubes for ages and kept at it till it worked.

Oh, I also grouped a much smaller patch, just bigger than the text footprint. as the recipient and that speeds it all up.

on the mac with 7.1 it was slower than the video implies and I don't seem to get as much shown on screen, but the end result is great.

I need this to be 'watertight' for STL export and I had very little internal clean-up to do.

cheers again Kirill

Any chance of utilising this method in a booleen tool, I can't get as clean an intersection with anything I've tried on a mac
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby kirill2008 » Sat Dec 26, 2009 8:28 pm

driven wrote:Anyway heres my test, on a torrus, with a material I made using blend(dot)rb, I'll put a You tube Texture anim up tomorrow.john

Actually I'm surprised a lot that it works for torus. The 1.0 version does not check if each face of ruling surface is the first one intersected by 'sticking' ray (but it has to perform such checking for the surface that is not terrain-like, I'm on my way to implement the mentioned checking).
So the only explanation is that torus faces near the text group were occasionally processed before other torus faces and other faces were occasionally ignored, or maybe a part of torus surface that is the most close one to the text was grouped and used as a ruling surface, as in the following video:
http://www.youtube.com/watch?v=8EB68JdEJSo

So the sticking result does not depend on smoothing, but on surface geometry.
torus.JPG

Everything is more or less obvious, but demands a bit of additional work to make the result of script processing more expected one, you know principle of least surprise (POLS)
.
0

kirill2008 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby driven » Sat Dec 26, 2009 8:58 pm

kirill2008 wrote:torus surface that is most close one to the text was grouped


Kirill
Exactly, on the mac I also re-surfaced the mesh and added detail with sandbox first, my model torus is 128 segments x 32 sides, so making a small patch is essential, experimenting with tube intersections now, had a couple of crashes, but I'm just playing around between domestic chores today, so maybe I'll have more luck later on.

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.0.

Postby driven » Tue Dec 29, 2009 6:27 am

Smooooth_Ramp_02.jpg


actually, I can report there's some sort of issue if I've used blend before trying to use this,

it's as if blend hold's on to a required file or path or something

if I quit and retry it works fine, only seems to be blend, but it may of been the problem the other day after I'd used CLF_SimpleLoft and 2Faces+path

I wasn't looking for a clash, but this is repeatable... nothing shows up in ruby or mac console, and I can't read the SU logs although I do have them.

cheers

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.1.

Postby driven » Sat Jan 02, 2010 3:02 am

Hi Kirill,

1.1 is even better, but I guess that's the point... well done.

I think anyone on the mailing list may have not know about the update yet because your edit of the top frame doesn't appear to send a 'new message' notification and I got a you tube 'new movie' email and came looking for it.

been playing with using it to apply decals, etc to objects. You can sort of do it with photo textures, but grouped or imbedded geometry is way nicer, and easier to change materials, so I'm very happy.

The text is single surface, no thickness
On my first test, which I binned (because it had a typo) I used- Yes check for non terrain, Front and Super, when it was cooked (much faster now) I exploded both groups, smoothed, softened and textured. I then did a volume check and there were no holes at all, perfect first time, except for the typo.

I binned it, changed the font and size, same settings. When cooked it sat off the surface (.25), with one end further away then the other? so I went though everything I could think of until I eventually got one that was almost right, added .002 thickness and merged that.
Nowhere near as nice as the first so I tried scaling down the text used the original settings and ended up with a perfect profile sitting exactly in the other surface, but I couldn't the two to intersect, so this one is actually .00025 in front off the drape ( so that you can see ti from all angles) and it's still grouped separately unlike the first.
EmbroidedCurtain.jpg

EmbroidedCurtainAnyone.skp
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Stick groups to mesh ver. 1.1.

Postby kirill2008 » Sat Jan 02, 2010 10:46 pm

driven wrote:Nowhere near as nice as the first so I tried scaling down the text used the original settings and ended up with a perfect profile sitting exactly in the other surface, but I couldn't the two to intersect, so this one is actually .00025 in front off the drape ( so that you can see ti from all angles) and it's still grouped separately unlike the first.

Hi, Driven.
It is strange, but I did not provide processing of the group with zero thickness, but it is necessary to do it.
In the current version (1.1., 1.2.), it is possible to process zero-thickness groups, but bounding boxes of such groups has to have a non-zero thickness (it is possible if rotate a bit a flat group, then explode it, then regroup again).
zero_thickness.JPG

mshstick 1 2 balls.skp

I promise to fix the problem to stick flat groups without any additional labor.
0

kirill2008 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: thinga, zul6041 and 25 guests

Visit our sponsors: