Pillow Script, request for method to put end points on factory curves.
All  1  2-10

Previous
Next
 From:  Michael Gibson
4512.2 In reply to 4512.1 
Hi Brian, yeah the semi-colon for a for( ) loop goes at the end of the statement that is being repeated - if you put it at the end of the for() itself, that basically makes an empty body for the for statement.

For placing a point at the end of a curve, check out this other command here:
http://moi3d.com/forum/messages.php?webtag=MOI&msg=2888.11

Basically you need to create an additional factory - one that knows how to build point objects, it's the same one used by the Draw curve > Point command. It takes a point input value and then you call .commit() on it to make it generate the point object.

See the command in the link above for an actual code example - let me know if that still does not make sense.

One way you can find out how to make a script for something is to find a command that constructs the kind of thing you need (like a line, point, arc, whatever), and then go look at the script for that command and you'll see in there what factory is involved and what inputs it is expecting to have set up.

- 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
4512.3 In reply to 4512.2 
Thank you Michael.
Sounds do-able with more study!
  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
4512.4 In reply to 4512.3 
Hi Brian, let me know if it still does not make sense and I will take a look into your script to give you some more specific help.

For stuff like how for( ) loops work in the JavaScript language, there is a pretty good resource here:
http://www.w3schools.com/js/default.asp

That's a bunch of tutorials and reference materials for doing web-page scripting, and that's the same script language that is used by MoI. There are a bunch of tutorials there and some reference materials for how different statements in the language 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:  bemfarmer
4512.5 
After many trials and tribulations, finally realized that the factory declaration was before the for loop.
Moved the factory declaration down 4 lines, inside the first for loop, and the script works just fine.
It was a fairly good learning experience though.
The script is set to just create the top half of the pillow. (Loft, and Mirror the bottom.)
The Height and Length of the pillow can be adjusted.
Used "interpcurve" curve type, which I believe is Through the points, versus "curve" type.
Hopefully there are not too many bugs.

Attached new Pillow3Web script.











Next up is escargot.

EDITED: 10 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
4512.6 In reply to 4512.5 
Hi Brian,

> Used "interpcurve" curve type, which I believe is Through
> the points, versus "curve" type.

Yup, that's correct.

- 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
4512.7 
Thank You.
  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:  Frenchy Pilou (PILOU)
4512.8 

EDITED: 24 Sep 2015 by PILOU

  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
4512.9 In reply to 4512.8 
How about "mark curve start"
Flip
"mark curve start"
?

- 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
 From:  bemfarmer
4512.10 In reply to 4512.8 
I'll have to look at this again, for the points.
Amazingly, its been 4 years!
Some learning has occurred meanwhile :-)

- 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
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-10