http://nickpisca.com/BLAST/index.php?title=Boundary_Cylinder-ssss&feed=atom&action=history
Boundary Cylinder-ssss - Revision history
2024-03-29T15:44:30Z
Revision history for this page on the wiki
MediaWiki 1.28.1
http://nickpisca.com/BLAST/index.php?title=Boundary_Cylinder-ssss&diff=23&oldid=prev
Nickpisca: Created page with "Direct: http://ssssociety.blogspot.com/2008/10/boundary-cylinder.html Option Explicit 'Author: YukiukiH 'Date: 10/08/2008 'compatibility: Rhino4 'boundary CYLINDER '-..."
2017-04-22T04:56:14Z
<p>Created page with "Direct: http://ssssociety.blogspot.com/2008/10/boundary-cylinder.html Option Explicit 'Author: YukiukiH 'Date: 10/08/2008 'compatibility: Rhino4 'boundary CYLINDER '-..."</p>
<p><b>New page</b></p><div>Direct: http://ssssociety.blogspot.com/2008/10/boundary-cylinder.html<br />
<br />
<br />
Option Explicit<br />
'Author: YukiukiH<br />
'Date: 10/08/2008<br />
'compatibility: Rhino4<br />
'boundary CYLINDER<br />
'----------------------------------------------------------------------------------------------<br />
Dim strTrgPt<br />
strTrgPt = Rhino.GetObject ("select a target point", 1)<br />
Dim strALLRefPts<br />
strALLRefPts = Rhino.GetObjects ("select reference points", 1)<br />
Dim strRefPts<br />
strRefPts = boundaryCylinder (strTrgPt, strALLRefPts, 200, 400)<br />
<br />
'color<br />
Dim intR, intG, intB<br />
Dim i<br />
For i = 0 To UBound(strRefPts)<br />
intR =255 <br />
intG =25+i*Rnd()*2<br />
intB =0<br />
Call Rhino.ObjectColor (strRefPts(i), RGB(intR, intG, intB))<br />
Next<br />
Call Rhino.print("execution completed")<br />
<br />
<br />
'----------------------------------------------------------------------------------------------<br />
'----------------------------------------------------------------------------------------------<br />
Function boundaryCylinder (strTrgPt, strALLRefPts, dblBoundR, dblBoundZ)<br />
Dim arrResult<br />
<br />
'coordinate extraction<br />
'---------------------------------------<br />
Dim arrTrgPt<br />
arrTrgPt = Rhino.PointCoordinates (strTrgPt)<br />
Dim arrALLRefPts()<br />
Dim i<br />
For i = 0 To UBound(strALLRefPts)<br />
ReDim Preserve arrALLRefPts(i)<br />
arrALLRefPts(i) = Rhino.PointCoordinates (strALLRefPts(i))<br />
Next<br />
<br />
'set boundary<br />
'---------------------------------------<br />
Dim arrFlatPt, arrFlatRefPt, dblDist, dblmaxZ, dblminZ<br />
Dim arrREFPts(), strRefPts()<br />
dblmaxZ = arrTrgPt(2) + dblBoundZ<br />
dblminZ = arrTrgPt(2)<br />
<br />
Dim n, m<br />
n = 0 <br />
For m = 0 To UBound(arrALLRefPts)<br />
arrFlatPt = Array(arrTrgPt(0), arrTrgPt(1), 0)<br />
arrFlatRefPt = Array(arrALLRefPts(m)(0),arrALLRefPts(m)(1), 0)<br />
dblDist = Rhino.Distance (arrFlatPt, arrFlatRefPt) <br />
If dblDist < dblBoundR Then<br />
If dblmaxZ>arrALLRefPts(m)(2) And arrALLRefPts(m)(2)>dblminZ Then<br />
<br />
Call Rhino.Print ("through point: " & CStr(n+1))<br />
ReDim Preserve arrRefPts(n)<br />
arrRefPts(n) = arrALLRefPts(m)<br />
ReDim Preserve strRefPts(n)<br />
strRefPts(n) = strALLRefPts(m)<br />
n = n+1<br />
<br />
End If<br />
End If<br />
Next<br />
'---------------------------------------<br />
arrResult = strRefPts<br />
boundaryCylinder = arrResult<br />
End Function<br />
'----------------------------------------------------------------------------------------------<br />
'----------------------------------------------------------------------------------------------<br />
<br />
<br />
[[Category:RhinoScript]]</div>
Nickpisca