The script for chain
 1-20  21-40  41-60  61-80

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

Previous
Next
 From:  Mauro (M-DYNAMICS)
6087.73 
Thank you 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.74 
If anyone wants to "hang" a chain, there is a catenary script on the forum, which works fairly well with a good radius guess.
I want to improve it by adding bisection, and re-examine the code.

- 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:  Bravlin
6087.75 
If i want "arraydir" command to start in "Extent, Count" mode, what Key script should i use ?
  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.76 In reply to 6087.75 
Hi Bravlin,

re:
> If i want "arraydir" command to start in "Extent, Count" mode, what Key script should i use ?

It's not possible currently because of the space character in there. I should be able to fix this for the next v4 beta though by making quote " " characters affect the parameter parsing for command parameters.

The current method breaks things into separate parameters just by spaces so it breaks that "Extent, Count" into 2 parameters instead of just keeping it as one.

I'll see if I can make both "mode=Extent, Count" or mode="Extent, Count" work.

- 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:  Bravlin
6087.77 In reply to 6087.76 
If key script with args is not available, maybe you can give us an advice on how to build simple .js plugins for this purpose ?
  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.78 In reply to 6087.77 
Hi Bravlin, yes a hack that will work right now would be to make copies of the 2 files ArrayDir.js and ArrayDir.htm which are in the commands subfolder. Name the copies something like ArrayDir2.js and ArrayDir2.htm and that will then make a command named ArrayDir2 available.

Inside ArrayDir2.htm find line 33 which makes the mode dropdown, it currently looks like this:
code:
	<moi:Select id="Mode">
		<moi:Option value="Offset, Count" textid="ArrayDir mode Offset, Count" />
		<moi:Option value="Extent, Count" textid="ArrayDir mode Extent, Count" />
		<moi:Option value="Offset, Extent" textid="ArrayDir mode Offset, Extent" />
	</moi:Select>


That will default to the first one in the list, but you can add a default="" attribute to control the initial default, so you want it to look like this:

code:
	<moi:Select id="Mode" default="Extent, Count">
		<moi:Option value="Offset, Count" textid="ArrayDir mode Offset, Count" />
		<moi:Option value="Extent, Count" textid="ArrayDir mode Extent, Count" />
		<moi:Option value="Offset, Extent" textid="ArrayDir mode Offset, Extent" />
	</moi:Select>


- 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:  Bravlin
6087.79 In reply to 6087.78 
Thanks Michael. It helps a lot. Maybe you also have some guides to moi script or hints & tricks page ?
  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
 From:  Michael Gibson
6087.80 In reply to 6087.79 
Hi Bravlin, there isn't very much on scripting documentation, what is available is here though: http://moi3d.com/wiki/Scripting .

I do have a fix for the next v4 beta where you'll be able to use " " characters in a shortcut key for values that have spaces in them.

- 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-20  21-40  41-60  61-80