The script for chain
 1-12  13-32  33-52  53-72  73-80

Previous
Next
 From:  bemfarmer
6087.53 In reply to 6087.51 
Added checkboxes for Twist chain and Rigid chain.

Having a faulty input #5 for Flow, incorrect string instead of the proper true/false variable Rigid,
resulted in the very slow Flow timing!!
Now Flow take less than one second, instead of 3.5 seconds.

After Link1 and Link2 no longer needed for future factories, removed them from the geometry.

Need to do cleanup of removing the factory results, in the event the cancel button is pressed.

Need to do a Twisted link.

- Brian

EDITED: 7 Jul 2014 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
6087.54 In reply to 6087.53 
I like the fact that you left the option to remove rigid. It allows you to make a "chainlike" form, which is cool too.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.55 In reply to 6087.54 
Thank you BurrMan.
The script still needs more work.
The checkboxes are hard to access. Several factory (s) need to be canceled or cleared out...
Have to check Michaels scripts to do this properly...

Flowing a chain around a rectangle is so-so in rigid mode, and makes weird corners in non-rigid mode.
Small radii curves cause chain overlap in rigid mode, and curved links in non-rigid mode.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
6087.56 In reply to 6087.55 
The chain needs to be made in Rigid mode, and any small kinks will just have to be manaually manipulated. I dont think there will be anything you could do about that without extensive development.

The non rigid is good for that. We bent links all the time on heavy lifts, though "not recommended"... :o
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.57 
Took another look at LineWeb script, and Pipe2 script, which both use several factory(s).
(The plural of factory denoted with (s), because "factories" is used as an array in some scripts.)

LineWeb deals with points and objects made from points, and factories which are arrays.

Pipe2 has PushButton Update which I'll try to add to the chain script, including removing objects appropriately.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.58 
Hi Michael

I am having trouble removing three things from the geometryDatabase, in order to prevent the creation of multiple copies of chains.

The first one is chainobj, which is an input to the FLOW factory.

The second one is baselineobj, whose first item is baseline, an input to the FLOW factory. (I haven't tried removing baseline from the geometryDatabase.)

The third one is flowedchainobj, which is the output of the chain factory.

My current theory is that asynchronous FLOW factory is interfering with the removal from the geometry Database.

For example the command: moi.geometryDatabase.removeObjects( chainobj ); placed before FLOW, does remove the arrayed chain from the screen.
However, placing it after FLOW does not appear to have any removal effect, and multiple chains can be created on top of each other by repeated updates.

FLOW commit does not seem to help.

Any Ideas?

Thankyou
- Brian

EDITED: 22 Aug 2013 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6087.59 In reply to 6087.58 
Hi Brian, you probably want to avoid calling .commit() on the various in-between factories. For a regular command, factory.commit() signals to the factory that the command has completely finished and the factory is completely done, once you call .commit() any further call to .cancel() won't do anything. Basically .commit() and .cancel() are mutually exclusive to one another.

Also any factory that has been created during a command goes on the "active factory list", and if the command ends without .commit() ever getting called, it will get automatically canceled during the command end cleanup processing. Either a .commit() or a .cancel() will pull that factory off of the active factory list, since it's considered to be completed after either of those calls.

So anyway probably if you just don't call .commit() for the things you don't want to persist in the geometry database that may cover it.

Otherwise if you do call .commit() you will have to manually remove things you don't want from the geometry database.

If you want to have factories remove the stuff they were showing in response to .update(), you can either call .cancel() on them if you're going to still be running the command (like for parameters changing), or if the command is ending you can actually just not do anything and then .cancel() gets called automatically for any active factory at the command end.

Does that make sense? Let me know if you are still having problems.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.60 In reply to 6087.59 
Thank you Michael
EDIT: Your descriptions ARE helping.


My script is flawed, and also my understanding . The pipe2 script is becoming more understandable, so I am going to adopt
its methods even more. Lineweb is helpful too.

I think I will make some more changes in my script, and even use a javascript array or two, and more subroutines.

I'm starting to think that .calculate() is more user friendly than .getCreatedObjects() ?

EDIT: Making a little progress. I had left out a few important things, and put in a few poor things. :-)

- Brian

EDITED: 22 Aug 2013 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.61 
Thought of the day: Chain links are like "Bones" in an animation program ?

Another thought: script to copy an object, based upon two points, to another location with two points... OK in 2D ?
Maybe ArrayGem does this.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6087.62 In reply to 6087.61 
Hi Brian,

> Another thought: script to copy an object, based upon two points, to another location with two points... OK in 2D ?
> Maybe ArrayGem does this.

Check out Transform > Orient > Line to line - it does that kind of transformation, which is just basically a move from one line's start point to the other line's start point, and then a rotation by the angle between them (and optionally a scale by the difference in length between them too).

It works like this:




ArrayGem is a slightly different, it builds a "base frame" around the starting circle, and then figures out a target frame that is oriented around the surface normal and then does a frame-to-frame transformation which is also really just a move + rotation as well though.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.63 In reply to 6087.62 
Thanks Michael

I'll try it out.

(Still working on the chain script, slowly :-) )

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mattj (MATTJENN)
6087.64 In reply to 6087.63 
Keep up the good work on the chain script, its looking good!!
matt
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.65 
After a lot of failure, trying to delete flowed chain outside of the subroutine, FINALLY
got it to work, using example of spur gear script, by assigning a chainList = Update(...). So simple and hard. :-)
Fixed simple link length, non-Updateable missing code.

Now to work on twist.

- Brian

EDITED: 7 Jul 2014 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Ditto
6087.66 In reply to 6087.65 
Bravo, bravo, bravo! Hats off for your tenacity, Brian!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.67 
Implemented the option to Twist the individual chain links.

Note that some trial and error, guided by the many helpful explanations of Michael, was necessary in order to discover
that Input "0" of the Twist factory would work with sweeplist, from var sweeplist = sweepfactory.calculate();,
but would not work with link1, from var link1 = sweeplist.item(0);.
Also, it was not necessary, in this case anyway, to add sweeplist to the moi.geometryDatabase with moi.geometryDatabase.addObjects( sweeplist );.

As an alternative test, the rail based upon a rounded rectangle worked well with the Twist factory, and would be another way to Twist the first chain link.
Twisting the rail is not done in the current version of the script.

There are several possibilities for the Twist axis. The one used seemed to look well.

The script worked well on one test 3d curve.


ArrayGem in 3d would need a surface for normal.
Chopping the curve up into points which are equally spaced in space, not necessarily equally spaced along the curve, and then
doing a copy to two points is another possibility, but probably needs normal also, in 3D.

This completes the chain script, for now.

I should probably delete old versions...?

- Brian

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6087.68 In reply to 6087.67 
Seems to work really well Brian!





- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  krass
6087.69 In reply to 6087.68 
WOW! Great job!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
6087.70 In reply to 6087.67 
SWEET Bem,

""""""""""I should probably delete old versions...?""""""""""""

I would leave them, in case others are following. But, at some point, you'll need space. Might have to start using skydrive or something, or the future generatinons will loose your input! :o
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6087.71 In reply to 6087.70 
Thank you Burr. Maybe next winter for "skydrive" or some such.
- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6087.72 In reply to 6087.71 
These particular files are super tiny though, like 3KB apiece, so they won't fill anything up for a long time...

Usually it's 3DM files with a lot of stuff in them that tends to fill up attachment space quickly. If you have a big 3DM file to share, that's what can be good to put on a file sharing service like skydrive or dropbox, etc...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-12  13-32  33-52  53-72  73-80