Script-Problem - Access to point-components
All  1-2  3-5

Previous
Next
 From:  Karsten (KMRQUS)
6622.3 In reply to 6622.2 
Hello Michael,

thank you for the Information. I tried to use the pts-array instead of a new one, but the Loop "for ( var n = 0; n < (pts.length-2); ++n )" seems not to be processed. If I replace the expression pts.length with a fixed value I got an error-message in the line
"cp=csp(pts[n].x,pts[n].y,pts[n].z,pts[n+1].x,pts[n+1].y,pts[n+1].z,pts[n+2].x,pts[n+2].y,pts[n+2].z);" that the object "pts[n+1]" does not exist. It seems that the array is empty??? Any ideas!

Thank you very much!
Karsten
  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
6622.4 In reply to 6622.3 
Hi Karsten, yeah it looks like you're missing one thing on the array curve factory - you need to set the number of items for the factory to build. The ReconstructCurve command that you're based off does this in an "Update()" function, like this:

Factories[i][0].setInput( 3, NumItems );


So before you call .calculate() on the arraycurve factory to generate the arrayed points, you need to set that input index 3 to have the number of points you want to generate, something like this (the >>>>>> <<<<< indicates the added line):

code:
       var Factory = moi.command.createFactory( 'arraycurve' ); //arraycurve erzeugt ein array entlang einer Kurve - Eingabe ist in der naechsten ZEile der Startpunkt der Kurve
       Factory.setInput( 0, startPtObject );		// object (list)
       Factory.setInput( 1, originalCrv );		// path
       Factory.setInput( 2, 'NumItems' );		// array mode

>>>>>> Factory.setInput( 3, 20 ); // Make 20 arrayed items <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

       Factories[i][0] = Factory;                      // in Factory sind die Punkte
       var arrayed_pts = Factories[i][0].calculate();





Does that help?

- 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
 From:  Karsten (KMRQUS)
6622.5 In reply to 6622.4 
Hello Michael,

thank you very much for the information! Yes that helps! The frustration goes and the joy of experimenting is coming back:-)
Now I will try to understand how to integrate the function in the update-mechanism.

Thank You for that great software!

Kind regards
Karsten
  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  3-5