I was looking for a surface builder, don't know if I'm missing something but Fredo's BezierSpline just does 2D curves.
But if there already is any sort of SU surface builder in existance I would love to know about it.
I was looking for a surface builder, don't know if I'm missing something but Fredo's BezierSpline just does 2D curves.
But if there already is any sort of SU surface builder in existance I would love to know about it.
But if I remove require()
Win32API doesn't find the file at all... and I'm guessing using a full path would actually fix that.
Yes the C++ code is fairly simple, I thought interfacing a working example with Ruby would be simple to make and compute faster, but as it turns out it needs alot of array transformations(which were nibbling away at my sanity) plus the added time cost of those it is very questionable if a direct Ruby compute would be any slower.
And since drawing is the real time hog it doesn't really matter.
How is thomthom doing the Bezier Surface? Ruby only?
Nope did not spot that, and I started work on this because I couldn't find any Sketchup surface builders anywhere.
Thanks for the heads up, guess I'm off the hook then
I'm just gonna wrap this one up into a slightly more wholesome package and direct people to the other version.
@unknownuser said:
Error Loading File NurbsPlugin.rb
> 127; The specified procedure could not be found. - Init_Nurbs
> C;/PROGRA~2/Google/GOOGLE~1/Plugins/Nurbs.dll
Nurbs.dll is in my plugins folder. Is this v7 only?
That is only Ruby trying to call an initialization command in DLL which doesn't exist, I tried adding some empty ones to get around the error message but nothing fixed it sofar.
This is only the first crack at the plugin, and I see I got alot of corners to trim.
http://sites.google.com/site/sketchyphysicstutorial/ - would be the most obvious.
Anyway a quick tutorial:
Thank you for the links.
So the first version is up and now I need to see if it works for anyone.
Main issues:
lack of UI (currently the control and grid creation are very limited)
needs a grid builder, vertices of existing models cannot be sorted into a usable grid so they need to be sampled (hope raycast isn't the only solution)
needs prebuilt grids, for a quick start on new projects
control grid presentation, not yet sure how the vertices should be presented (actual geometry is easy to control but adds unnecessary data, and virtual data requires writing new tools (move, rotate, scale))
DLL can calculate the surface very quick, but Sketchup needs a long time to draw it, is there a direct optimized way of doing this?
Not drawing faces until the final edit may be a good choice.
I can't seem to find one, not even a bad one so I guess I'll take a shot at it.
Now uploaded version 0.1:
Took way longer then expected but the data flow was all sorts of messed up, so now I have a very crude working version, missing all UI and is set up very specifically / badly.
But I wanted to share the first draft so maybe someone can be inspired to pitch in with ideas for the interface.
Files included:
Use:
EDIT: Removed the files as they are not prime time ready, and I don't want people to end up with shoddy plugins.
If anyone wants the code I'll send you what I have.
It's true, during the time webdialog loads all commands to it will be ignored, but timers are not the best system to avoid it because you never know how long it will take on someones machine.
So a much cleaner way that I only recently found out about:
wd=UI;;WebDialog.new
wd.show{
wd.execute_script("fillTextBox();")
}
All commands inside the "show" block it will be run right after the webdialog shows, so there will be no loss of time.
Well I always suggest having a walk through http://sites.google.com/site/sketchyphysicstutorial/
Essentially SketchyPhysics has no moving concave shapes, indents and holes can't be so easily done.
But what you can do is group basic shapes together to create an approximation of what you need.
So here is the jist of Anton's code:
Capture mouse (Sketchup will stop reacting to it):
getForegroundWindow=Win32API.new("user32", "GetForegroundWindow", [], "L")
Win32API.new("user32", "SetCapture", "L", "L").call(getForegroundWindow.call())
Read all key states (keyboard and mouse):
@getKeyboardState=Win32API.new("user32", "GetKeyboardState", "P", "V")
@lpKeyState=" "*256
@getKeyboardState.call(@lpKeyState)
@lpKeyState will hold an array of 256 numbers for all the keys.
@lpKeyState[1,2,4] - [1]left-mouse, [2]right-mouse, [4]middle-mouse
@lpKeyState[48..57] - keyboard keys 0 to 9
Release mouse
Win32API.new("user32", "ReleaseCapture", "V", "L").call()
Changed it so it now works but explaining all the IF's and BUT's is best done by the tutorial and wiki.
http://sites.google.com/site/sketchyphysicstutorial/
http://sketchyphysics.wikia.com/wiki/SketchyPhysicsWiki
Ya I do most my models in SU7 because it tends to crash alot less combined with SketchyPhysics.
I'm not sure what exactly happens in the transformation to SU8, but atleast fixing it is quick.
Any way to include mouse wheel into this, it seems there is no code for it among the button lineup.
Not strictly necessary but it's nice to get the control.
Damn I remember figuring this error out, but now I'm not sure what exactly it was.
I think it hasto do with different Sketchup versions, or a model from SU8 converted back to a lower version, something of that kind.
If you got an example model of this post it here I'm sure I can find what's causing it again.
I believe the simplest solution was to copy/paste the model content to a new model.
Well it's a pretty complex model if you want to do it mechanically.
SketchyPhysics doesn't have flexible objects so those belts would need to be chain belts (like tank tracks) and those are infamous for their unreliability not to mention the lag of all those parts moving at once.
Going one easier would be to just have several rollers/cylinders lined up that would carry the objects along.
Or the simplest one would be to just make it scripted.
I'll put some examples together, and I suggest checking out http://sites.google.com/site/sketchyphysicstutorial/ to get started on SP.
Very nice, that works perfectly in SP!
Is there a way to just get the full array of buttons and not call the function for every button specifically because it seems like a waste.
We could still use a callback feature for other plugins.
Maybe someone else here knows how to set that up?
I eagerly await your results, I will help out in any way I can to finally bring this old project to full life.
I assume it would also come in very handy when making other plugins and tools.
I looked it up and TrueSpace is still available for free, but the company was bought and dissected by Microsoft so they are not working on it anymore.
It has Blender level capabilities, just their shared model system doesn't look that good.
From the youtube videos it seems like every change takes 5-20 seconds between performing an action an that action affecting the model, surely this is a secure system but that is in no way usable (could just be a bad video).
But I'll still check how that all works, thank you for bringing it up.
Awesome clip mate, I'm glad my scripts were good for something