Replace Closed Curves With Circle
 1-15  16-21

Previous
Next
 From:  Karsten (KMRQUS)
8080.16 In reply to 8080.13 
Hello Pilou,

I thought also about the problem and I agree with Michael. A simple, but very coarse filter would be to analyse boundingbox aspect ratio and the curve length in relationship to the absolute dimesions of the boundingbox.
And I have to note, the script CCWC isn't my project, it is an example to show the input parameters of the circle-factory in
Mindsets script! So I didn't tested it really.

Have a nice day
Karsten
p.s.: I have tried to implement gestures in MOIs scriptengine and it is a similar, but difficult problem.
http://moi3d.com/forum/index.php?webtag=MOI&msg=8078.6

EDITED: 10 Sep 2016 by KMRQUS

  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:  Marius
8080.17 
Hello,
Does it possible to create a similar script that changes closed curves with circle to nearest integer value from the specific range? For example I type range from 2 to 6, curves closest to this values (from 1,51 to 6,50 in this case) are change with nearest integer value circle, assign any unique styles group by value and the rest outside the range are hide.
Sorry for my English, I hope it's understandable.
Thank you in advance for your help.
  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
8080.18 In reply to 8080.17 
Possible? I think Yes.
Augment the script with .htm file to select some or all closed curves,
and also to request the desired range of "dist" (dist = box.diagonalLength;), as distMin, and distMax.
distMin and distMax can be any value, not just integers.


Filter the selected closed curves with "dist", as follows:

If a closed curve's "dist" value is outside of the range, do not process that closed curve.

If a closed curve's "dist" value is inside the range, process that closed curve.
modify factory.setInput( 3, (Math.sqrt(dist*dist/2)/2));, by applying
Math.round(Math.sqrt(dist*dist/2)/2)),
or Math.ceil(), or Math.floor(),
to get the circle's radius in an integer value.

- 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:  Marius
8080.19 In reply to 8080.18 
Heh :-). Thank you Brian. I'm not a programmer but I understand idea and I'll try translate your helpful hints into a complete script. Trial and error method :-).

Marius
  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
8080.20 In reply to 8080.19 
Maybe combine and modify RCCWC.js, lineweb.js and lineweb.htm, and maybe some other script...

Looking forward to your new script.

- 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:  Marius
8080.21 In reply to 8080.20 
Math.round is best option but I had to move the closing bracket

from
Math.round(Math.sqrt(dist*dist/2)/2))
to
Math.round(Math.sqrt(dist*dist/2))/2)

Thanks again :). I'm trying to take next step, but for me it is sci-fi :-D. Your support helped me a lot.

Marius
  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-15  16-21