perp-perp distance analysis
All  1-12  13-19

Previous
Next
 From:  Michael Gibson
4547.13 In reply to 4547.11 
Hi Burr, thanks for the video description that helps clear it up.

So yeah you don't want any "perp/perp" type of thing for your case, so that CrvDeviation tool in Rhino will not work for this case.

Doing a set of y-axis aligned lines like you showed there will work but the accuracy will be limited to whatever density of lines you used. But you can probably do a pretty large number of them just in the general area where you know the spot is at.

Then doing a script that just selects the longest curve from all existing ones in the model is definitely possible without much fuss - here's one that you can set up on a shortcut key:

script: /* select longest curve */ var curves = moi.geometryDatabase.getObjects().getCurves(); var maxlen = -1; var maxcrv = null; for ( var i = 0; i < curves.length; ++i ) { var crv = curves.item(i); if ( crv.hidden || crv.locked ) { continue; } var thislen = crv.getLength(); if ( thislen> maxlen ) { maxlen = thislen; maxcrv = crv; } } if ( maxcrv != null ) maxcrv.selected = true;

That will look through all curves that are not hidden or locked, it does not only look at lines, so if you have some curves that you don't want to have considered (like the original ones that you are measuring between) lock or hide those before running the script.

Hope that helps!

- 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:  Frenchy Pilou (PILOU)
4547.14 
so you have now 2 scripts ;)
---
Pilou
Is beautiful that please without concept!
My Gallery
  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
4547.15 In reply to 4547.14 
Hi Michael,
Thanks for the help.

Frenchy,
Thanks for looking in... Yes the curves are all planar and the sketchup script does the measurment too, 2... :)
  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)
4547.16 
@Michael
Does it possible to have the smallest curve ?
I have made some try without success but a little headache ;)
At first view some inverse sign and other trivial changements but not so easy for me :D

Added the biggest :)
http://moiscript.weebly.com/select-biggest--smallest.html

Ps What happen if there are 2 biggest equal?
Seem the first created is selected :)

Pss And it's a curious workflow : nothing must be selected before lauch the script!
I have make many try before find it by hasard :D

EDITED: 26 Sep 2011 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:  Michael Gibson
4547.17 In reply to 4547.16 
Hi Pilou,

> Does it possible to have the smallest curve ?

Yup, this script will select the smallest curve instead:

script: /* select shortest curve */ var curves = moi.geometryDatabase.getObjects().getCurves(); var minlen = 1e100; var mincrv = null; for ( var i = 0; i < curves.length; ++i ) { var crv = curves.item(i); if ( crv.hidden || crv.locked ) { continue; } var thislen = crv.getLength(); if ( thislen < minlen ) { minlen = thislen; mincrv = crv; } } if ( mincrv != null ) mincrv.selected = true;


> Ps What happen if there are 2 biggest equal?
> Seem the first created is selected :)

Yup, that's correct.


> Pss And it's a curious workflow : nothing must be selected
> before lauch the script!

Yup, it adds the shortest or longest one to the selection without disturbing other already selected objects. That allows for more flexibility - for example if you want to select both the shortest and the longest curve you can start with nothing selected and then run both of those scripts and you'll then have that selection at the end. If each script cleared the selection first then it wouldn't be possible to do that anymore.

But if you do want everything else to be deselected, it's possible to do that by adding a call to moi.geometryDatabase.deselectAll(); at the start of the scripts.

- 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:  Frenchy Pilou (PILOU)
4547.18 In reply to 4547.17 
Well well all is clear now!
So 2 more little scripts who can be useful for tricky things!

var minlen = 1e100; that was this that I have missed !
Near the infinite of the number of stars ;)
---
Pilou
Is beautiful that please without concept!
My Gallery
  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:  Frenchy Pilou (PILOU)
4547.19 
---
Pilou
Is beautiful that please without concept!
My Gallery
  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-12  13-19