http://nickpisca.com/BLAST/api.php?action=feedcontributions&user=Nickpisca&feedformat=atom
scripting - User contributions [en]
2024-03-29T13:23:49Z
User contributions
MediaWiki 1.28.1
http://nickpisca.com/BLAST/index.php?title=MediaWiki:Vector.css&diff=363
MediaWiki:Vector.css
2019-03-14T22:57:07Z
<p>Nickpisca: Created page with "/* CSS placed here will affect users of the Vector skin */ /* increase Vector sidebar width to accommodate ads */ div#mw-panel { width: 12em; } div#p-Ads div.body {margin: 0em..."</p>
<hr />
<div>/* CSS placed here will affect users of the Vector skin */<br />
/* increase Vector sidebar width to accommodate ads */<br />
div#mw-panel { width: 12em; }<br />
div#p-Ads div.body {margin: 0em !important; }<br />
div#footer, #mw-head-base, div#content { margin-left: 12em; }<br />
#left-navigation { margin-left: 12em; }</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=User:Nickpisca&diff=362
User:Nickpisca
2019-03-14T22:46:38Z
<p>Nickpisca: </p>
<hr />
<div>'''Nicholas Pisca<br><br />
<br />
<font size="-2" color="red"><br />
[http://www.nickpisca.com www.nickpisca.com]<br><br><br />
Founder [https://www.0001design.com 0001d]<br><br />
Wiki [[Main Page|0001d BLAST]]<br><br />
Digital Blogger [http://www.nickpisca.com/sherpa 0001d Sherpa] <br><br />
Diesel Projects [http://www.nickpisca.com/diesel IDI Online] <br><br />
WVO Innovator [http://www.nickpisca.com/wvo Waste Vegetable Oil Fuel Travel] <br><br />
Editor [http://www.gtwiki.org GTWiki]<br><br />
Faculty [http://arch.usc.edu/ USC] [http://www.sciarc.edu/portal/programs/graduate/mediascapes/index.html MediaSCAPES] [http://www.sciarc.edu SCIarc]<br><br />
Lecturer [http://www.mat.ucsb.edu/faculty.php#npisca UCSB-Media Arts Technology]<br><br />
Author "[http://stores.lulu.com/nickpisca YSYT - Maya MEL Basics for Designers]"<br><br />
Technical Manager <br />
<font color="blue">Gehry Technologies</font><br><br />
</font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=User:Nickpisca&diff=361
User:Nickpisca
2019-03-14T22:45:51Z
<p>Nickpisca: Undo revision 360 by Nickpisca (talk)</p>
<hr />
<div>'''Nicholas Pisca<br><br />
<br />
<font size="-2" color="red"><br />
[http://www.nickpisca.com www.nickpisca.com]<br><br><br />
Founder [https://www.0001design.com 0001d]<br><br />
Wiki [[Main Page|0001d BLAST]]<br><br />
Digital Blogger [http://www.nickpisca.com/sherpa 0001d Sherpa] <br><br />
Diesel Projects [http://www.nickpisca.com/diesel IDI Online] <br><br />
WVO Innovator [http://www.nickpisca.com/wvo Waste Vegetable Oil Fuel Travel] <br><br />
Editor [http://www.gtwiki.org GTWiki]<br><br />
Faculty [http://arch.usc.edu/ USC] [http://www.sciarc.edu/portal/programs/graduate/mediascapes/index.html MediaSCAPES] [http://www.sciarc.edu SCIarc]<br><br />
Lecturer [http://www.mat.ucsb.edu/faculty.php#npisca UCSB-Media Arts Technology]<br><br />
Author "[http://stores.lulu.com/nickpisca YSYT - Maya MEL Basics for Designers]"<br><br />
Technical Manager <br />
<font color="blue">Gehry Technologies</font><br><br />
</font><br />
<br />
<br />
<br />
{{#widget:AdSense<br />
|name=myadname<br />
|client=ca-pub-5553769294231406<br />
|slot=7449032183<br />
|width = 468<br />
|height = 60<br />
}}</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=User:Nickpisca&diff=360
User:Nickpisca
2019-03-14T22:44:04Z
<p>Nickpisca: </p>
<hr />
<div>'''Nicholas Pisca<br><br />
<br />
<font size="-2" color="red"><br />
[http://www.nickpisca.com www.nickpisca.com]<br><br><br />
Founder [https://www.0001design.com 0001d]<br><br />
Wiki [[Main Page|0001d BLAST]]<br><br />
Digital Blogger [http://www.nickpisca.com/sherpa 0001d Sherpa] <br><br />
Diesel Projects [http://www.nickpisca.com/diesel IDI Online] <br><br />
WVO Innovator [http://www.nickpisca.com/wvo Waste Vegetable Oil Fuel Travel] <br><br />
Editor [http://www.gtwiki.org GTWiki]<br><br />
Faculty [http://arch.usc.edu/ USC] [http://www.sciarc.edu/portal/programs/graduate/mediascapes/index.html MediaSCAPES] [http://www.sciarc.edu SCIarc]<br><br />
Lecturer [http://www.mat.ucsb.edu/faculty.php#npisca UCSB-Media Arts Technology]<br><br />
Author "[http://stores.lulu.com/nickpisca YSYT - Maya MEL Basics for Designers]"<br><br />
Technical Manager <br />
<font color="blue">Gehry Technologies</font><br><br />
</font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=User:Nickpisca&diff=359
User:Nickpisca
2019-03-14T22:36:45Z
<p>Nickpisca: </p>
<hr />
<div>'''Nicholas Pisca<br><br />
<br />
<font size="-2" color="red"><br />
[http://www.nickpisca.com www.nickpisca.com]<br><br><br />
Founder [https://www.0001design.com 0001d]<br><br />
Wiki [[Main Page|0001d BLAST]]<br><br />
Digital Blogger [http://www.nickpisca.com/sherpa 0001d Sherpa] <br><br />
Diesel Projects [http://www.nickpisca.com/diesel IDI Online] <br><br />
WVO Innovator [http://www.nickpisca.com/wvo Waste Vegetable Oil Fuel Travel] <br><br />
Editor [http://www.gtwiki.org GTWiki]<br><br />
Faculty [http://arch.usc.edu/ USC] [http://www.sciarc.edu/portal/programs/graduate/mediascapes/index.html MediaSCAPES] [http://www.sciarc.edu SCIarc]<br><br />
Lecturer [http://www.mat.ucsb.edu/faculty.php#npisca UCSB-Media Arts Technology]<br><br />
Author "[http://stores.lulu.com/nickpisca YSYT - Maya MEL Basics for Designers]"<br><br />
Technical Manager <br />
<font color="blue">Gehry Technologies</font><br><br />
</font><br />
<br />
<br />
<br />
{{#widget:AdSense<br />
|name=myadname<br />
|client=ca-pub-5553769294231406<br />
|slot=7449032183<br />
|width = 468<br />
|height = 60<br />
}}</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=User:Nickpisca&diff=358
User:Nickpisca
2019-03-12T04:16:08Z
<p>Nickpisca: </p>
<hr />
<div>'''Nicholas Pisca<br><br />
<br />
<font size="-2" color="red"><br />
[http://www.nickpisca.com www.nickpisca.com]<br><br><br />
Founder [https://www.0001design.com 0001d]<br><br />
Wiki [[Main Page|0001d BLAST]]<br><br />
Digital Blogger [http://www.nickpisca.com/sherpa 0001d Sherpa] <br><br />
Diesel Projects [http://www.nickpisca.com/diesel IDI Online] <br><br />
WVO Innovator [http://www.nickpisca.com/wvo Waste Vegetable Oil Fuel Travel] <br><br />
Editor [http://www.gtwiki.org GTWiki]<br><br />
Faculty [http://arch.usc.edu/ USC] [http://www.sciarc.edu/portal/programs/graduate/mediascapes/index.html MediaSCAPES] [http://www.sciarc.edu SCIarc]<br><br />
Lecturer [http://www.mat.ucsb.edu/faculty.php#npisca UCSB-Media Arts Technology]<br><br />
Author "[http://stores.lulu.com/nickpisca YSYT - Maya MEL Basics for Designers]"<br><br />
Technical Manager <br />
<font color="blue">Gehry Technologies</font><br><br />
</font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Main_Page&diff=357
Main Page
2017-04-25T19:36:42Z
<p>Nickpisca: </p>
<hr />
<div><!--<font size="-7" color="red">[[Image:BackToNP.jpg|right|thumb|100px|http://www.nickpisca.com]]</font>--><br />
'''<font size="6" color="red">0001D BLAST - SCRIPTING WIKI</font> ''' <font size="-2" color="red"><div align="right"> Main Site: [http://www.0001design.com 0001D Home Page] . [http://www.nickpisca.com/sherpa 0001d blog] Back to [http://www.nickpisca.com nickpisca.com].</div></font><br />
<br />
<font size="-2" color="red">ARCHITECTURE / VISUAL EFFECTS / CINEMA / WEB / DESIGN</font><br />
<br />
[[Image:SphereModel07sfw.jpg|right|thumb|400px|MEL scripted cellular 3D Print vrml color [[Spheriolithography]] technique pioneered by Nick Pisca.]]<br />
<br />
<font size="-2" color="red">'''0001d BLAST''' is the meta scripting resource for architects, web designers, engineers, animators and others using computational methods for visual effects, BIM, advanced modeling and parametric design. Algorithmic designer [[User:Nickpisca|Nick Pisca]] started this wiki to facilitate the users of the main scripting languages (MEL, VB, RVB, AS, etc) and collect disparate macros across the net. <br />
<br />
'''0001d BLAST''' is open to all computational designers and aspiring scripters. Users must sign in to edit and create new articles. Feel free to add to the current library lists, or make all new categories.<br />
<br />
'''0001d BLAST''' is reserved for links and contributions of quality. Do not post hyperlinks to sites whose designers do not openly distribute their source codes.</font><br />
<br />
== <font size="+1" color="red">'''Languages''' </font>==<br />
* [[:Category:MEL|MEL]] <br />
* [[:Category:CATIA DP VB|CATIA DP VB]]<br />
* [[:Category:RhinoScript|RhinoScript]]<br />
* [[:Category:ActionScript|ActionScript]]<br />
* [[:Category:AutoCAD VB|AutoCAD VB]]<br />
* [[:Category:Processing|Processing]]<br />
* [[:Category:Python|Python]]<br />
* [[:Category:Batch Files|Batch Files]]<br />
* [[:Category:Revit Journal|Revit Journal]]<br />
* [[:Category:Revit VB.NET|Revit VB.NET]]<br />
* [[:Category:CSharp|CSharp]]<br />
<br />
<br />
'''<font size="+1" color="red">[[YSYT MEL Book]]</font> ''' ++ <br />
'''<font size="+1" color="red">[[Academic Archives]]</font> ''' ++ <br />
'''<font size="+1" color="red">[[Outside Resources]]</font> ''' ++<br />
'''<font size="+1" color="red">[[Image Gallery]]</font> '''<br><br />
<br />
<font size="-2" color="red">[[YSYT Maya MEL Book]] * * <br />
[http://www.mediawiki.org/wiki/Help:Formatting Text Formatting] * * <br />
[http://meta.wikimedia.org/wiki/Help:Contents User's Guide] * * <br />
[http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ] </font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Category:Processing&diff=356
Category:Processing
2017-04-25T19:35:28Z
<p>Nickpisca: Created page with "'''Processing Library'''<br> <font size="-2">Open Sorcerers: [http://www.nickpisca.com Nick Pisca 0001d] ''Keywords: processing '' </font>"</p>
<hr />
<div>'''Processing Library'''<br><br />
<font size="-2">Open Sorcerers: [http://www.nickpisca.com Nick Pisca 0001d]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
''Keywords: processing ''<br />
</font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Scripting:About&diff=355
Scripting:About
2017-04-24T22:02:51Z
<p>Nickpisca: Created page with "'''0001d BLAST''' is the meta scripting resource for architects, web designers, engineers, animators and others using computational methods for visual effects, BIM, advanced m..."</p>
<hr />
<div>'''0001d BLAST''' is the meta scripting resource for architects, web designers, engineers, animators and others using computational methods for visual effects, BIM, advanced modeling and parametric design. Algorithmic designer [http://www.nickpisca.com Nick Pisca] started this wiki to facilitate the users of the main scripting languages and collecting disparate macros across the net. <br />
<br />
'''0001d BLAST''' is open to all computational designers and aspiring scripters. Users must sign in to edit and create new articles. Feel free to add to the current library lists, or make all new categories.<br />
<br />
'''0001d BLAST''' is reserved for links and contributions of quality. Do not post hyperlinks to sites whose designers do not openly distribute their source codes.</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Scripting:General_disclaimer&diff=354
Scripting:General disclaimer
2017-04-24T22:02:29Z
<p>Nickpisca: Created page with "The information on this wiki is provided on an as-is basis. Authors, contributors, and administrators of this wiki shall have neither liability nor responsibility to any pers..."</p>
<hr />
<div>The information on this wiki is provided on an as-is basis. Authors, contributors, and administrators of this wiki shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this wiki.<br />
<br />
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied.<br />
<br />
Posting of original content from this site is prohibited, but hyperlinks to articles is permitted. Academic and commercial use of original content is permitted, as long as the author and site is cited.</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Image_Gallery&diff=353
Image Gallery
2017-04-24T21:57:54Z
<p>Nickpisca: </p>
<hr />
<div>[[Image:SphereModel07sfw.jpg|thumb|400px|[[:Category:MEL|MEL]] scripted cellular 3D Print vrml color [[Spheriolithography]] technique pioneered by Nick Pisca.]]<br />
<br />
[[Image:N005sfw.jpg|thumb|400px|[[:Category:MEL|MEL]] scripted cellular 3D Print for Flesh[]logically++Transparent project by Nick Pisca.]]<br />
<br />
[[Image:RampModel04sfw.jpg|thumb|400px|Multi Rampshader automation on several NURBS closed surfaces. [[:Category:MEL|MEL]] scripted by Nick Pisca.]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Category:CATIA_DP_VB&diff=352
Category:CATIA DP VB
2017-04-24T21:12:55Z
<p>Nickpisca: </p>
<hr />
<div>'''CATIA and Digital Project Visual Basic Library'''<br />
Visit my work at the GTWiki regarding [http://www.gtwiki.org/mwiki/index.php?title=Category:Automation_Functions Automation Functions]. Due to the recent changes at Gehry Technologies, many of these functions can be found on the [https://web-beta.archive.org/web/20120430082827/http://www.gtwiki.org/mwiki/index.php?title=Category:Automation_Functions online archive]. <br />
<br />
<font size="-2">Open Sorcerers: [http://www.nickpisca.com Nick Pisca 0001d], [http://www.sheetd.com/ sheetd] <br />
</font><br />
<br />
<br />
<br />
'''[[VB Error Message Guide]]'''<br />
<br />
<font size="-2">''Keywords: CATIA, Functions, Procedures, Subroutines, Scripts, CATVBA, BAS, Visual Basic, VB</font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=VB_Error_Message_Guide&diff=351
VB Error Message Guide
2017-04-24T20:49:46Z
<p>Nickpisca: </p>
<hr />
<div>__TOC__<br />
<br />
<br />
<br />
=== Method 'GetImpl' of Object 'ArcFactoryManager' failed ===<br />
1.) Line geometry driver may be non-connex.<br />
<br />
=== Method 'AddWall' of object 'ArcFactoryManager' failed ===<br />
1.) Support geometry may not be updated, may be non-connex or invalid.<br />
<br />
=== Object doesn't support this property of method ===<br />
===== On ArcSlabs =====<br />
When updating the "thickness," the value property does not appear in the autoformatting. Users must input "Value" in manually.<br />
<br />
<br />
[[Category:CATIA DP VB]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SelectElement3_Values&diff=350
SelectElement3 Values
2017-04-24T20:49:24Z
<p>Nickpisca: </p>
<hr />
<div>Values to use as selection filter.<br />
Role: Values which can be given as filter to Selection.SelectElement2, Selection.SelectElement3, Selection.IndicateOrSelectElement2D or Selection.IndicateOrSelectElement3D, beside the automation object names.<br />
Values:<br />
<br />
ZeroDim<br />
Topological 0-D entity (such as a Point2D )<br />
<br />
MonoDim<br />
Topological 1-D entity which cannot be infinite (such as a HybridShapeSpline)<br />
<br />
MonoDimInfinite<br />
Topological 1-D entity which may be infinite, such as a HybridShapeSpline (not infinite) or a HybridShapeLinePtDir for which a call to HybridShapeLinePtDir.GetLengthType would give 1, 2 or 3 (infinite)<br />
<br />
RectilinearMonoDim<br />
1-D entity which cannot be infinite, the entity having a rectilinear geometry<br />
<br />
RectilinearMonoDimInfinite<br />
1-D entity which may be infinite, the entity having a rectilinear geometry<br />
<br />
BiDim<br />
Topological 2-D entity which cannot be infinite (such as a HybridShapeCylinder )<br />
<br />
BiDimInfinite<br />
Topological 2-D entity which may be infinite, such as a HybridShapeCylinder (non infinite) or a HybridShapePlaneOffsetPt (infinite)<br />
<br />
PlanarBiDim<br />
2-D entity which cannot be infinite, the entity having a planar geometry<br />
<br />
PlanarBiDimInfinite<br />
2-D entity having a planar geometry<br />
<br />
CylindricalBiDim<br />
2-D entity which cannot be infinite, the entity having a cylindrical geometry<br />
<br />
TriDim<br />
Topological 3-D entity (such as a Pad ) <br />
<br />
<br />
<br />
Thanks to this forum post: http://www.catiav5forum.de/wbb3/wbb/index.php?page=Thread&threadID=2167&l=4<br />
<br />
<br />
[[Category:CATIA DP VB]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=KeepTrimOrientation&diff=349
KeepTrimOrientation
2017-04-24T20:48:51Z
<p>Nickpisca: </p>
<hr />
<div> Function KeepTrimOrientation(TrimObj As HybridShapeTrim, nthSmallest As Integer) As Boolean<br />
Dim UVal As Integer<br />
Dim VVal As Integer<br />
UVal = -1<br />
Dim WinningArr(3)<br />
Dim WinningOri(3)<br />
Dim TempArr(1)<br />
Dim WinArrNum As Integer<br />
WinArrNum = 0<br />
Dim CMeas<br />
Dim CLen As Double<br />
ForceColorObjUgly TrimObj, 120, 120, 220, 1, 1000, 3, 1000<br />
<br />
While UVal <= 1<br />
VVal = -1<br />
While VVal <= 1<br />
TrimObj.FirstOrientation = UVal<br />
TrimObj.SecondOrientation = VVal<br />
IsUpdatable TrimObj<br />
Set CMeas = TheSPAWorkbench.GetMeasurable(TrimObj)<br />
CLen = CMeas.Length<br />
<br />
WinningArr(WinArrNum) = CLen<br />
TempArr(0) = UVal<br />
TempArr(1) = VVal<br />
WinningOri(WinArrNum) = TempArr<br />
WinArrNum = WinArrNum + 1<br />
VVal = VVal + 2<br />
Wend<br />
UVal = UVal + 2<br />
Wend <br />
<br />
Sort2Arrays WinningArr, WinningOri <br />
<br />
TrimObj.FirstOrientation = WinningOri(nthSmallest)(0)<br />
TrimObj.SecondOrientation = WinningOri(nthSmallest)(1)<br />
IsUpdatable TrimObj <br />
<br />
End Function<br />
<br />
<br />
[[Category:CATIA DP VB]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Main_Page&diff=348
Main Page
2017-04-24T20:41:59Z
<p>Nickpisca: Protected "Main Page" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</p>
<hr />
<div><!--<font size="-7" color="red">[[Image:BackToNP.jpg|right|thumb|100px|http://www.nickpisca.com]]</font>--><br />
'''<font size="6" color="red">0001D BLAST - SCRIPTING WIKI</font> ''' <font size="-2" color="red"><div align="right"> Main Site: [http://www.0001design.com 0001D Home Page] . [http://www.nickpisca.com/sherpa 0001d blog] Back to [http://www.nickpisca.com nickpisca.com].</div></font><br />
<br />
<font size="-2" color="red">ARCHITECTURE / VISUAL EFFECTS / CINEMA / WEB / DESIGN</font><br />
<br />
[[Image:SphereModel07sfw.jpg|right|thumb|400px|MEL scripted cellular 3D Print vrml color [[Spheriolithography]] technique pioneered by Nick Pisca.]]<br />
<br />
<font size="-2" color="red">'''0001d BLAST''' is the meta scripting resource for architects, web designers, engineers, animators and others using computational methods for visual effects, BIM, advanced modeling and parametric design. Algorithmic designer [[User:Nickpisca|Nick Pisca]] started this wiki to facilitate the users of the main scripting languages (MEL, VB, RVB, AS, etc) and collect disparate macros across the net. <br />
<br />
'''0001d BLAST''' is open to all computational designers and aspiring scripters. Users must sign in to edit and create new articles. Feel free to add to the current library lists, or make all new categories.<br />
<br />
'''0001d BLAST''' is reserved for links and contributions of quality. Do not post hyperlinks to sites whose designers do not openly distribute their source codes.</font><br />
<br />
== <font size="+1" color="red">'''Languages''' </font>==<br />
* [[:Category:MEL|MEL]] <br />
* [[:Category:CATIA DP VB|CATIA DP VB]]<br />
* [[:Category:RhinoScript|RhinoScript]]<br />
* [[:Category:ActionScript|ActionScript]]<br />
* [[:Category:AutoCAD VB|AutoCAD VB]]<br />
* [[:Category:Processing|Processing]]<br />
* [[:Category:Python|Python]]<br />
* [[:Category:Batch Files|Batch Files]]<br />
* [[:Category:Revit Journal|Revit Journal]]<br />
* [[:Category:Revit VB.NET|Revit VB.NET]]<br />
* [[:Category:CSharp|CSharp]]<br />
<br />
<br />
'''<font size="+1" color="red">[[YSYT MEL Book]]</font> ''' ++ <br />
'''<font size="+1" color="red">[[Academic Archives]]</font> ''' ++ <br />
'''<font size="+1" color="red">[[Outside Resources]]</font> ''' ++<br />
'''<font size="+1" color="red">[[Case Studies]]</font> ''' ++<br />
'''<font size="+1" color="red">[[Image Gallery]]</font> '''<br><br />
<br />
<font size="-2" color="red">[[YSYT Maya MEL Book]] * * <br />
[http://www.mediawiki.org/wiki/Help:Formatting Text Formatting] * * <br />
[http://meta.wikimedia.org/wiki/Help:Contents User's Guide] * * <br />
[http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ] </font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Hexbased_CA_Script-Kokkugia&diff=347
Hexbased CA Script-Kokkugia
2017-04-24T20:33:40Z
<p>Nickpisca: Created page with "http://www.kokkugia.com/wiki/scriptLibrary/mel/CA_Script.mel https://web-beta.archive.org/web/20100401000000*/http://www.kokkugia.com/wiki/scriptLibrary/mel/CA_Script.mel..."</p>
<hr />
<div>http://www.kokkugia.com/wiki/scriptLibrary/mel/CA_Script.mel<br />
<br />
https://web-beta.archive.org/web/20100401000000*/http://www.kokkugia.com/wiki/scriptLibrary/mel/CA_Script.mel<br />
<br />
<br />
<br />
<br />
/* this series of scripts creates a hex-grid cellular automaton and a springs net which can be driven by the 'brains'<br />
of the cellular automaton. these two things were created in order to then act as an input for the distortion of<br />
far more complex geometries in the formation of a facade or screen wall element.<br />
<br />
created by roland snooks and dave pigram fall 2005<br />
(parts of the code use the logic of cory clarke's - life.mel - nthd.org)<br />
<br />
this version last modified: 28 october 2005<br />
<br />
procedures:<br />
<br />
there are four main procedures which can be run independantly.<br />
each of these main procedures calls a second series of procedures shown indented below (a full description of all<br />
procedures follws):<br />
<br />
- hexCA_create<br />
- hexCA_run<br />
- hexCA_check<br />
- life_keyframe<br />
- hexCA_status<br />
- springCA_create<br />
- springCA_attach<br />
- hex_associate<br />
<br />
example of appropriate inputs: <br />
<br />
hexCA_create 20 10 1 30; (int $xSize, int $ySize, float $hexSize, float $randCut)<br />
hexCA_run 20 10 20 1; (int $xSize, int $ySize, int $steps, int $proliferate)<br />
springCA_create 20 10 1; (int $xSize, int $ySize, float $hexSize)<br />
hex_associate 0.08; (float $scale)<br />
<br />
description of input variables:<br />
<br />
$xSize = the number of hexagons in the x-axis numbered left to right<br />
$ySize = the number of hexagons in the y-axis numbered top to bottom<br />
$hexSize = the shortest distance from edge to edge of the chosen hexagon size<br />
$randCut = the percentage (as an integer between 1 and 100) of the hex-grid that starts at full size<br />
(the remainding cells start at the minimum size)<br />
$proliferate = 0 or 1 switches between modes of proliferation (of copies of generations):<br />
0 = no proliferation (any other integer besides 1 will also result in no proliferation)<br />
1 = proliferation in a stack along the z axis (perpendicular to the 2 CA dimensions x and y)<br />
$scale = a scale factor to tune the spring length inputs of the hex_associate procedure to the particular<br />
characteristics of the springs net<br />
<br />
full descriptions of all procedures:<br />
<br />
- hexCA_create<br />
creates a hex-grid $xSize by $ySize with each hexagon $hexSize wide and numbers all the cells logically. an initial<br />
state is also generated by randomly switching a percentage ($randCut) of cells to the maximum size.<br />
this procedure must be run before the hexCA_run or the life_keyframe, or else these procedures will have no meaning.<br />
<br />
- hexCA_run<br />
as the name indicates, this procedure uses a pre-determined rule-set to calculate and represent future generational<br />
states for the the hex-grid (from its initial state) generated by the hexCA_create procedure. for each hex-cell in<br />
turn this procedure calls the hexCA_check procedure which checks the size of all adjacent cells (its 'neigbours' - <br />
including itself) the average size is returned and then compared against a series of axiomatic conditions. if the <br />
average of the result is too high the cell 'dies' due to 'overcrowding'; if it is too low the cell 'dies' of <br />
'loneliness'. in this case 'dying' means becoming zero scale, there is nothing to prevent the cell being 're-born'<br />
in a future generation. if the cell survives the initial culling process it then adopts the average size of its<br />
neighbours and itself.<br />
<br />
all calculations are done on a per-generation basis i.e the calcualtions for all cells are completed before any<br />
size changes are made, then the process is repeated after all scaling is complete.<br />
<br />
lastly, as the above described system has a tendency towards an even distribution of middle-sized cells, an additional<br />
'switch' has been added as a means of re-injecting 'energy' or disequilibrium into the system. when the average size<br />
of a hex-cells neighbours approaches the middle of the possible range that cell is either given a maximum or minimum<br />
scale in the next generation. if the avaerage is slightly less than the middle the cell gets a maximum size; when the <br />
average is slightly higher it receives a minimum scale.<br />
<br />
- hexCA_check<br />
as described above this procedure is called by the hexCA-run procedure, with the average of all neighbouring cell sizes<br />
returned (becoming $tmp) to the the hexCA_run script. <br />
<br />
- life_keyframe<br />
this procedure is also called by the hexCA-run procedure, it adds keyframes so that the CA can be watched changing<br />
states as an animation. the keyframes occur at set intervals and represent each complete generation. the set interval<br />
between keyfames is equal to the $frameNoPerCalc variable which can be found at the beginning of the hexCA_run procedure.<br />
<br />
- hexCA_status<br />
a very simple procedure which literally returns the value of the .status attribute for a particular hex-cell when called<br />
by the hexCA_run procedure.<br />
<br />
- springCA_create<br />
this procedure creates a cube on every node of an $xSize x $ySize hex-grid. each cube is named according to the<br />
adjacent hex-cells from top to bottom and from left to right. the hex-cells are also named from top to bottom and<br />
from left to right in the form: hex_$y_$x where $y is the row number and $x is the cell number within that row.<br />
<br />
example:<br />
the cube named: "cube1_1__1_2__2_1" is between hec-cells: "hex_1_1" , "hex_1_2" and "hex_2_1"<br />
<br />
- springCA_attach<br />
this procedure is called by the springCA_create procedure and attaches springs to cubes that represent each vertex<br />
of a $xSize x $ySize hex-grid the cubes are created by the springCA_create script - the inputs are $xSize and $ySize.<br />
for every spring a line is drawn in the same place for later use in diagrams and animations.<br />
<br />
- hex_associate<br />
this procedure calculates the average scale of the two hexes which are adjacent to all internal springs and then uses this value<br />
to set that springs rest length. when the simulation is played the springs attempt to find the new equilibrium state for network<br />
thus distorting the previously regular hex-grid geometry.<br />
through experience this operation is most successful when the cubes on the outside edge of the springs net are set to active = 0 (off).<br />
<br />
<br />
note: the programming style adopted priveledges readablility and maintainability rather than pure code efficiency<br />
this approach was selected both because the script is being created and edited by two people and because the <br />
intention is that certain sections of code can be cut out as modules for use in future projects.<br />
*/<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
global proc hexCA_create (int $xSize, int $ySize, float $hexSize, float $randCut){<br />
<br />
// if uncommented these lines select and delete all objects and keyframes remaining from previous iterations<br />
/*<br />
select -all;<br />
delete;<br />
*/<br />
//loop for each cell row following $ySize<br />
<br />
int $y = 0;<br />
while ($y < $ySize){<br />
<br />
//loop for each cell column following $xSize <br />
<br />
int $x = 0;<br />
while ($x < $xSize){<br />
<br />
// set up values for moving each created hex-grid object to its correct place in the hex-grid<br />
// a check of oddness, fascilitates the staggering of every second row to the right<br />
// $stagger will equal zero for the even rows, and half $hexSize for the odd rows <br />
<br />
int $isOdd = $y%2;<br />
float $stagger = $isOdd * $hexSize/2;<br />
float $moveX = $x*$hexSize + $stagger;<br />
float $moveY = $y*$hexSize*-cosd(30);<br />
<br />
//create a unique name for each object that refers to its position<br />
<br />
$name = "hex_" + $y + "_" + $x;<br />
<br />
//create the object, give it the unique name and then move it into position<br />
<br />
float $radius = abs(($hexSize/2)/cosd(30));<br />
<br />
$tmp = `circle -n $name -c 0 0 0 -nr 0 0 1 -sw 360 -r $radius -d 1 -ut 0 -tol 0.1 -s 6 -ch 1`;<br />
<br />
move $moveX $moveY 0;<br />
<br />
// add custom attributes that will store information about the hex-grid object<br />
<br />
addAttr -ln status -at double $name; <br />
addAttr -ln oncount -at double $name;<br />
<br />
// the following section of code was used to connect the CA to different geometry based on clusters earlier<br />
// in the project - it remains (commented out) to facilitate a possible renewal of the exploration into that<br />
// type of geometry <br />
<br />
// set driven keys - assign the scale of the hex cell to the scale of the clusters<br />
/*<br />
setAttr ($name + ".scaleX") 1;<br />
setAttr ("cluster_" + $y + "_" + $x + ".scaleX") 1;<br />
setAttr ("cluster_" + $y + "_" + $x + ".scaleY") 1;<br />
setAttr ("cluster_" + $y + "_" + $x + ".scaleZ") 1;<br />
<br />
setDrivenKeyframe -cd ($name + ".scaleX") ("cluster_" + $y + "_" + $x + ".scaleX");<br />
setDrivenKeyframe -cd ($name + ".scaleX") ("cluster_" + $y + "_" + $x + ".scaleY");<br />
setDrivenKeyframe -cd ($name + ".scaleX") ("cluster_" + $y + "_" + $x + ".scaleZ");<br />
<br />
setAttr ($name + ".scaleX") 0;<br />
setAttr ("cluster_" + $y + "_" + $x + ".scaleX") 0;<br />
setAttr ("cluster_" + $y + "_" + $x + ".scaleY") 0;<br />
setAttr ("cluster_" + $y + "_" + $x + ".scaleZ") 0;<br />
<br />
setDrivenKeyframe -cd ($name + ".scaleX") ("cluster_" + $y + "_" + $x + ".scaleX");<br />
setDrivenKeyframe -cd ($name + ".scaleX") ("cluster_" + $y + "_" + $x + ".scaleY"); <br />
setDrivenKeyframe -cd ($name + ".scaleX") ("cluster_" + $y + "_" + $x + ".scaleZ"); <br />
*/ <br />
//randomly turn some on<br />
<br />
$random = rand(0,100); <br />
if($random < $randCut) { <br />
<br />
//setAttr ($tmp[0] + ".visibility") on; <br />
setAttr ($tmp[0] + ".status") 1;<br />
setAttr ($tmp[0] + ".scale") 1 1 1;<br />
setAttr ($tmp[0] + ".oncount") 1;<br />
setKeyframe ($tmp[0] + ".scale");<br />
setKeyframe ($tmp[0] + ".status");<br />
<br />
}else{<br />
//setAttr ($tmp[0] + ".visibility") off;<br />
setAttr ($tmp[0] + ".status") 0;<br />
setAttr ($tmp[0] + ".scale") 0 0 0;<br />
setAttr ($tmp[0] + ".oncount") 0;<br />
setKeyframe ($tmp[0] + ".scale");<br />
setKeyframe ($tmp[0] + ".status");<br />
<br />
}<br />
<br />
$x++;<br />
<br />
}<br />
<br />
$y++;<br />
<br />
}<br />
<br />
//keyframe all at 0<br />
<br />
currentTime 0;<br />
//life_keyframe();<br />
<br />
}<br />
<br />
print("hexCA_create loaded ..... Enjoy!\n");<br />
<br />
<br />
;<br />
<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
global proc hexCA_run(int $xSize, int $ySize, int $steps, int $proliferate){<br />
<br />
int $step = 1;<br />
float $maxoncount = 1.0;<br />
int $frameNoPerCalc = 20;<br />
<br />
while($step < $steps){<br />
<br />
//check each box and store in list to turn on or off<br />
<br />
int $x;<br />
int $y;<br />
int $check;<br />
string $onarray[];<br />
string $offarray[];<br />
string $onset;<br />
string $offset;<br />
select -cl;<br />
$onset = `sets`;<br />
select -cl;<br />
$offset = `sets`;<br />
<br />
<br />
$y =0;<br />
while($y < $ySize){<br />
<br />
$x = 0;<br />
while($x < $xSize){<br />
<br />
// this is where the axioms of the cellular automata appear and determine the behaviour of the system<br />
<br />
// the first rule determines if the cell being checked is 'lonely'<br />
<br />
float $tmp = hexCA_check($x,$y,$xSize,$ySize); <br />
print("this is the temp" + $tmp + "!");<br />
if($tmp > 0 && $tmp < 0.45){<br />
<br />
$string = "hex_" + $y + "_" + $x;<br />
print("on " + $string);<br />
sets -add $onset $string;<br />
setAttr ("hex_" + $y + "_" + $x + ".status") $tmp;<br />
setAttr ("hex_" + $y + "_" + $x + ".scale") $tmp $tmp $tmp;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".scale");<br />
setKeyframe ("hex_" + $y + "_" + $x + ".status");<br />
}<br />
<br />
else if ($tmp >= 0.45 && $tmp < 0.55){<br />
<br />
$string = "hex_" + $y + "_" + $x;<br />
print("middle " + $string);<br />
sets -add $onset $string;<br />
setAttr ("hex_" + $y + "_" + $x + ".status") 1;<br />
setAttr ("hex_" + $y + "_" + $x + ".scale") 1 1 1;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".scale") ;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".status");<br />
}<br />
<br />
else if ($tmp >= 0.55 && $tmp < 0.65){<br />
<br />
$string = "hex_" + $y + "_" + $x;<br />
sets -add $offset $string;<br />
setAttr ("hex_" + $y + "_" + $x + ".status") 0;<br />
setAttr ("hex_" + $y + "_" + $x + ".scale") 0 0 0;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".scale") ;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".status");<br />
}<br />
<br />
else if ($tmp >= 0.65 && $tmp <= 0.9){<br />
<br />
$string = "hex_" + $y + "_" + $x;<br />
print("on " + $string);<br />
sets -add $onset $string;<br />
setAttr ("hex_" + $y + "_" + $x + ".status") $tmp;<br />
setAttr ("hex_" + $y + "_" + $x + ".scale") $tmp $tmp $tmp;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".scale") ;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".status");<br />
<br />
<br />
}else{<br />
<br />
$string = "hex_" + $y + "_" + $x;<br />
sets -add $offset $string;<br />
setAttr ("hex_" + $y + "_" + $x + ".status") 0;<br />
setAttr ("hex_" + $y + "_" + $x + ".scale") 0 0 0;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".scale") ;<br />
setKeyframe ("hex_" + $y + "_" + $x + ".status"); <br />
}<br />
<br />
$x++;<br />
}<br />
$y++;<br />
}<br />
<br />
$onarray = `sets -q $onset`;<br />
$offarray = `sets -q $offset`;<br />
<br />
print("Frame: " + ($step * 20) + "\n");<br />
currentTime ($step * 20);<br />
<br />
<br />
// this part of the script creates copies of each state/generation that are then distributed as a<br />
// layered history of the life of the CA - or in order to be laser cut if (and only if) $proliferate <br />
// is set to 1 or 2 respectively.<br />
<br />
// check $proliferate state<br />
<br />
if($proliferate == 1 || $proliferate == 12){<br />
<br />
// first create a new group for each genaration ready to receive copies of each cell in that genearation<br />
<br />
string $genGroupName = "gen_" + $step;<br />
group -n $genGroupName -em;<br />
<br />
// loop to select each hex-cell in turn,<br />
// then duplicate it and name its copy.<br />
// and then parent the copy to the group named according to its generation<br />
<br />
$y =0;<br />
while($y < $ySize){<br />
<br />
$x = 0;<br />
while($x < $xSize){<br />
<br />
string $hexCopyName = $genGroupName + "_hex_" + $y + "_" + $x; <br />
select ("hex_" + $y + "_" + $x);<br />
duplicate -n $hexCopyName;<br />
parent $hexCopyName $genGroupName;<br />
<br />
$x++;<br />
}<br />
<br />
$y++;<br />
}<br />
<br />
// test which proliferation mode and move entire generation accordingly<br />
<br />
// first test is for direct proliferation of each generation along the z-axis<br />
<br />
if($proliferate == 1){<br />
<br />
nurbsSquare -c 9.6 -4 -2 -nr 0 0 1 -sl1 12 -sl2 24 -sps 1 -d 3 -ch 1 ;<br />
select -add $genGroupName;<br />
move 0 0 (2*$step);<br />
}<br />
<br />
}<br />
<br />
$step++;<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
global proc life_keyframe(){<br />
<br />
select -all;<br />
$list = `ls -sl -tr`;<br />
<br />
$j = 0;<br />
while($j < size($list)){<br />
<br />
setKeyframe ($list[$j] + ".v");<br />
$j++;<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
global proc float hexCA_check(int $x, int $y,int $xSize, int $ySize){<br />
<br />
float $total;<br />
float $lowerLimit = 0.1;<br />
float $upperLimit = 0.9;<br />
<br />
$plusx = (($x+1) % $xSize);<br />
if($x >= 1) $minusx = ($x-1);<br />
if($x < 1) $minusx = ($xSize-1);<br />
<br />
$plusy = (($y+1) % $ySize);<br />
if($y >= 1) $minusy = ($y-1);<br />
if($y < 1) $minusy = ($ySize-1);<br />
<br />
// calculate the neighbours of the hex cell<br />
<br />
$a = "hex_" + $minusy + "_" + $plusx;<br />
$b = "hex_" + $y + "_" + $plusx;<br />
$c = "hex_" + $plusy + "_" + $plusx;<br />
$d = "hex_" + $plusy + "_" + $x;<br />
$e = "hex_" + $y + "_" + $minusx;<br />
$f = "hex_" + $minusy + "_" + $x;<br />
$g = "hex_" + $y + "_" + $x;<br />
<br />
// rules for hex cell life<br />
<br />
// rule 01 - based on how many neighbours are on or off<br />
<br />
float $total = (hexCA_status($a) + hexCA_status($b) + hexCA_status($c) + hexCA_status($d) + hexCA_status($e) + hexCA_status($f) + hexCA_status($g))/7;<br />
<br />
if($total > $lowerLimit && $total < $upperLimit){<br />
//print("total" + ($total) + "\n");<br />
return $total;<br />
<br />
}else{<br />
<br />
return 0;<br />
<br />
}<br />
<br />
return 0;<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
global proc float hexCA_status(string $hexCell){<br />
<br />
// this global procedure returns the status of each hex-cell<br />
<br />
float $v = `getAttr ($hexCell + ".status")`;<br />
return $v;<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
<br />
//__________________________________________________________________________________________________________________<br />
global proc springCA_create (int $xSize, int $ySize, float $hexSize){<br />
<br />
<br />
// if uncommented these lines select and delete all objects and keyframes remaining from previous iterations<br />
/*<br />
select -all;<br />
delete;<br />
*/<br />
// loop for each cell row following $ySize (note that the cell rows referred to here are the hex-cells<br />
// for this orientation of the hex-cells (point up) there are actually four rows of cubes (which make <br />
// up the vertices of each hex) for each row of hex-cells, but because two overlap, after the first row<br />
// of hex-cells the rest have only two rows of cubes each <br />
<br />
int $y = 1;<br />
while ($y <= $ySize) {<br />
<br />
//int $modulor = $y%2;<br />
//print("row" + $y + <br />
<br />
//loop for each cell column following $xSize <br />
<br />
int $x = 1;<br />
while ($x <= $xSize + 1) {<br />
<br />
// create a cube for each vertex of the hex grid and name it according to the three adjacent hex_cells<br />
// trigonometry is used to calculate the movement of each cube relative to the entered $hexSize<br />
<br />
// calculate trigonometric values for movement<br />
<br />
float $adj = $hexSize * 0.5;<br />
float $hyp = $adj / (cosd(30));<br />
float $opp = $adj * tand(30);<br />
<br />
// calculate a stagger value (again for movement) that includes a test and allowance for odd rows<br />
<br />
float $stagger = (($y+1)%2) * 0.5 * $hexSize;<br />
<br />
// set up naming variables - minus signs will be represented by an underscore<br />
// as spacers: "_" appears between y and x, and "__" appears between hex-cell pairs <br />
<br />
string $cellRef = $y + "_" + $x;<br />
string $cellLeftRef = $y + "_" + ($x-1);<br />
string $cellRightRef = $y + "_" + ($x+1);<br />
string $cellBelowLeftRef = ($y+1) + "_" + ($x-1);<br />
string $cellBelowRightRef = ($y+1) + "_" + $x;<br />
string $cellAboveLeftRef = ($y-1) + "_" + ($x-1);<br />
string $cellAboveRightRef = ($y-1) + "_" + $x;<br />
<br />
// the first two rows of cubes (occuring on hex-cell row zero) have no neighbouring cells<br />
// above and so are created first as special cases<br />
<br />
// make the first 'special' row - there is one less cube in this row so exclude x = $xSize<br />
<br />
if ($y == 1 && $x != $xSize + 1){<br />
<br />
string $cubeName = "cube" + $cellAboveLeftRef + "__" + $cellAboveRightRef + "__" + $cellRef;<br />
float $moveX = $x * $hexSize - $hexSize;<br />
float $moveY = -$y * cosd(30) * $hexSize + $hyp + $hexSize;<br />
<br />
$tmp = `polyCube -n $cubeName -w .1 -h .1 -d .1`;<br />
move $moveX $moveY 0;<br />
<br />
<br />
print("first row" + $x + "\n");<br />
<br />
}<br />
<br />
// make the second 'special' row<br />
<br />
if ($y == 1){<br />
<br />
$cubeName = "cube" + $cellAboveLeftRef + "__" + $cellLeftRef + "__" + $cellRef;<br />
$moveX = ($x - 0.5) * $hexSize - $hexSize;<br />
$moveY = -$y * cosd(30) * $hexSize + $opp + $hexSize;<br />
<br />
$tmp = `polyCube -n $cubeName -w .1 -h .1 -d .1`;<br />
move $moveX $moveY 0;<br />
}<br />
<br />
// now that the 'special cases' of the first two rows are done, make the rest of the rows of cubes<br />
<br />
// make the first standard row<br />
// the if stagger > 0 statement establishes whether the row is odd and changes the name if necessary<br />
<br />
$cubeName = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowLeftRef;<br />
<br />
if ($stagger > 0){<br />
<br />
print("row is even" + $y + "\n");<br />
$cubeName = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowRightRef;<br />
}<br />
$moveX = ($x - 0.5) * $hexSize + $stagger - $hexSize;<br />
$moveY = -$y * cosd(30) * $hexSize - $opp + $hexSize;<br />
<br />
$tmp = `polyCube -n $cubeName -w .1 -h .1 -d .1`;<br />
move $moveX $moveY 0; <br />
<br />
// next make the second standard row of cubes<br />
// the if/else statement prevents the additional cube that would be created in the last row<br />
<br />
int $lastRow = ($ySize);<br />
<br />
if(($y == $lastRow) && ($x == 1)){<br />
<br />
print ("skipping cube!\n");<br />
<br />
}else{<br />
<br />
$cubeName = "cube" + $cellRef + "__" + $cellBelowLeftRef + "__" + $cellBelowRightRef;<br />
<br />
if ($stagger > 0){<br />
<br />
print("row is even" + $y + "\n");<br />
$cubeName = "cube" + $cellLeftRef + "__" + $cellBelowLeftRef + "__" + $cellBelowRightRef;<br />
}<br />
$moveX = $x * $hexSize - $stagger - $hexSize;<br />
$moveY = -$y * cosd(30) * $hexSize - $hyp + $hexSize;<br />
<br />
$tmp = `polyCube -n $cubeName -w .1 -h .1 -d .1`;<br />
move $moveX $moveY 0;<br />
<br />
}<br />
<br />
$x++;<br />
<br />
}<br />
<br />
$y++;<br />
<br />
} <br />
<br />
print ("springCA_create loaded ..... \n");<br />
print ("\n");<br />
print ("loading: springCA_attach .....\n");<br />
print ("\n");<br />
<br />
// call springCA_attach global procedure to attach springs to the cubes just created<br />
<br />
springCA_attach $xSize $ySize;<br />
}<br />
<br />
<br />
<br />
<br />
<br />
//__________________________________________________________________________________________________________________<br />
global proc springCA_attach (int $xSize, int $ySize){<br />
<br />
float $damping = 40;<br />
float $stiffness = 50;<br />
<br />
int $y = 1;<br />
while ($y <= $ySize) {<br />
<br />
//loop for each cell column following $xSize <br />
<br />
int $x = 1;<br />
while ($x <= $xSize+1) {<br />
<br />
// set up naming variables - minus signs will be represented by an underscore<br />
// as spacers: "_" appears between y and x, and "__" appears between hex-cell pairs <br />
<br />
string $cellRef = $y + "_" + $x;<br />
string $cellLeftRef = $y + "_" + ($x-1);<br />
string $cellRightRef = $y + "_" + ($x+1);<br />
string $cellBelowLeftRef = ($y+1) + "_" + ($x-1);<br />
string $cellBelowRightRef = ($y+1) + "_" + $x;<br />
string $cellAboveLeftRef = ($y-1) + "_" + ($x-1);<br />
string $cellAboveRightRef = ($y-1) + "_" + $x;<br />
string $cellBelowFarRightRef = ($y-1) + "_" + ($x+1);<br />
<br />
int $oddness = $y%2;<br />
<br />
<br />
// the first row of springs has no neighbours above it and so is added first as a special case<br />
<br />
// attach first special row of springs to existing cubes<br />
// there are two springs per cell in the first special row so exclude last loop ($x = $xSize + 1)<br />
<br />
if ($y == 1 && $x != $xSize + 1){<br />
<br />
// in each loop connect spring for top left side of hex until all springs are added for the row<br />
<br />
string $cube01 = "cube" + $cellAboveLeftRef + "__" + $cellLeftRef + "__" + $cellRef;<br />
string $cube02 = "cube" + $cellAboveLeftRef + "__" + $cellAboveRightRef + "__" + $cellRef;<br />
string $cube03 = "cube" + $cellAboveRightRef + "__" + $cellRef + "__" + $cellRightRef;<br />
<br />
string $springName01 = "spring_" + $cellAboveLeftRef + "__" + $cellRef;<br />
string $springName02 = "spring_" + $cellAboveRightRef + "__" + $cellRef;<br />
<br />
select -r $cube01 $cube02;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName01;<br />
<br />
<br />
// do the same for the top right side of each hex<br />
<br />
select -r $cube02 $cube03;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName02;<br />
<br />
}<br />
<br />
// now attach the first standard row of springs<br />
// they run vertically and there is one more spring than there are hexes in each row (loop $x = $xSize remains)<br />
<br />
// reference names following conventions for odd rows<br />
<br />
$cube01 = "cube" + $cellAboveLeftRef + "__" + $cellLeftRef + "__" + $cellRef;<br />
$cube02 = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowLeftRef;<br />
<br />
$springName01 = "spring_" + $cellLeftRef + "__" + $cellRef;<br />
<br />
// test if row is even and if so rename cube references so that the right cubes are joined by the springs<br />
<br />
if($oddness == 0){<br />
<br />
$cube01 = "cube" + $cellAboveRightRef + "__" + $cellLeftRef + "__" + $cellRef;<br />
$cube02 = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowRightRef;<br />
}<br />
select -r $cube01 $cube02;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName01;<br />
<br />
<br />
// now attach the second standard row of springs<br />
// there are two springs per cell this row so again exclude last loop ($x = $xSize)<br />
<br />
if($x != $xSize + 1){<br />
<br />
// references for cubes in odd rows<br />
<br />
$cube01 = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowLeftRef;<br />
$cube02 = "cube" + $cellRef + "__" + $cellBelowLeftRef + "__" + $cellBelowRightRef;<br />
$cube03 = "cube" + $cellRef + "__" + $cellRightRef + "__" + $cellBelowRightRef;<br />
<br />
$springName01 = "spring_" + $cellRef + "__" + $cellBelowLeftRef;<br />
$springName02 = "spring_" + $cellRef + "__" + $cellBelowRightRef;<br />
<br />
// test if row is even and if so rename cube references so that the right cubes are joined by the springs<br />
<br />
if($oddness == 0){<br />
<br />
$cube01 = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowRightRef;<br />
$cube02 = "cube" + $cellRef + "__" + $cellBelowRightRef + "__" + ($y+1) + "_" + ($x+1);<br />
$cube03 = "cube" + $cellRef + "__" + $cellRightRef + "__" + ($y+1) + "_" + ($x+1);<br />
<br />
$springName01 = "spring_" + $cellRef + "__" + $cellBelowRightRef;<br />
$springName02 = "spring_" + $cellRef + "__" + $cellBelowFarRightRef;<br />
}<br />
select -r $cube01 $cube02;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName01;<br />
<br />
select -r $cube02 $cube03;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName02;<br />
<br />
}<br />
// there is one spring that is not added at either end depending on whether the row is even or odd<br />
// add this spring<br />
<br />
if($oddness == 1 && $x == $xSize + 1){<br />
<br />
$cube01 = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowLeftRef;<br />
$cube02 = "cube" + $cellRef + "__" + $cellBelowLeftRef + "__" + $cellBelowRightRef;<br />
<br />
$springName01 = "spring_" + $cellRef + "__" + $cellBelowLeftRef;<br />
<br />
select -r $cube01 $cube02;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName01;<br />
<br />
}<br />
if($oddness == 0 && $x == 1 && $y != $ySize){<br />
<br />
$cube01 = "cube" + $cellLeftRef + "__" + $cellBelowLeftRef + "__" + $cellBelowRightRef;<br />
$cube02 = "cube" + $cellLeftRef + "__" + $cellRef + "__" + $cellBelowRightRef;<br />
<br />
$springName01 = "spring_" + $cellLeftRef + "__" + $cellBelowRightRef;<br />
<br />
select -r $cube01 $cube02;<br />
constrain -spring -st $stiffness -d $damping -i 0 -n $springName01;<br />
<br />
}<br />
<br />
$x++; <br />
<br />
}<br />
<br />
$y++;<br />
<br />
} <br />
select -r "cluster*";<br />
group -n allClusters;<br />
<br />
select -r "curve*";<br />
group -n allCurves;<br />
<br />
<br />
<br />
print ("springCA_attach loaded ..... Enjoy!\n");<br />
}<br />
<br />
<br />
<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
global proc hex_associate(float $scale){<br />
<br />
// this procedure associates the scale of the adjacent hexes to the spring length<br />
<br />
int $numOfTokens;<br />
string $springName[];<br />
string $springNameArray[];<br />
float $hexScale01;<br />
float $hexScale02;<br />
float $hexValue;<br />
string $hex01;<br />
string $hex02;<br />
<br />
// get an array of the springs <br />
<br />
select -r "spring*";<br />
$springName = `ls -sl`;<br />
print $springName;<br />
$i = 0;<br />
<br />
while( $i < size($springName)){<br />
<br />
// tokenise<br />
<br />
$numOfTokens = tokenize ($springName[$i], "_", $springNameArray);<br />
print $springNameArray;<br />
<br />
// if it isn't on the edge then assign a rest length<br />
<br />
$hex01 = ("hex_" + $springNameArray[1] + "_" + $springNameArray[2]);<br />
$hex02 = ("hex_" + $springNameArray[3] + "_" + $springNameArray[4]);<br />
<br />
if(`objExists $hex01` && `objExists $hex02`){<br />
<br />
// get hex scales<br />
<br />
$hexScale01 = `getAttr ("hex_" + $springNameArray[1] + "_" + $springNameArray[2] + ".scaleX")`;<br />
$hexScale02 = `getAttr ("hex_" + $springNameArray[3] + "_" + $springNameArray[4] + ".scaleX")`;<br />
<br />
$hexValue = ($scale*(($hexScale01 + $hexScale02) / 2));<br />
<br />
// assign hex scale to spring rest length<br />
setAttr ($springName[$i] + ".springRestLength") $hexValue;<br />
<br />
}<br />
<br />
$i++;<br />
<br />
}<br />
<br />
print ("hex_associate loaded ..... Enjoy!\n"); <br />
<br />
}<br />
<br />
print ("hex_CA suite loaded ..... Enjoy!\n");<br />
<br />
<br />
<br />
//____________________________________________________________________________________________________________________<br />
// uncomment the next lines to allow the scripts to run automatically<br />
/*<br />
hexCA_create 20 10 1 35;<br />
hexCA_run 20 10 50 0;<br />
*/<br />
//or<br />
/* <br />
springCA_create 20 10 1;<br />
*/ <br />
//or<br />
/* <br />
hex_associate 1;<br />
*/ <br />
<br />
<br />
<br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=AttractorToolsOrient-Kokkugia&diff=346
AttractorToolsOrient-Kokkugia
2017-04-24T20:26:05Z
<p>Nickpisca: Created page with "http://www.kokkugia.com/wiki/scriptLibrary/rvb/attractorToolsOrient.rvb https://web-beta.archive.org/web/20101214095823/http://www.kokkugia.com/wiki/scriptLibrary/rvb/attract..."</p>
<hr />
<div>http://www.kokkugia.com/wiki/scriptLibrary/rvb/attractorToolsOrient.rvb<br />
<br />
https://web-beta.archive.org/web/20101214095823/http://www.kokkugia.com/wiki/scriptLibrary/rvb/attractorToolsOrient.rvb<br />
<br />
<br />
<br />
<br />
Option Explicit<br />
'------------------------------------------------------------------------------<br />
' Subroutine: attractorToolsOrient<br />
' Purpose: orients objects toward multiple attractors with a falloff<br />
' Author: Roland Snooks | 2006 | www.kokkugia.com<br />
'------------------------------------------------------------------------------<br />
<br />
Call Main()<br />
Sub Main()<br />
Dim i, j, arrObjects, arrAttract, thresholdDist, scaleFactor, arrBBox, arrCntrPt, counter, arrAttPt <br />
Dim dblAttDistTest, dblClosestAttDist, dblClosestAtt, adjAmount<br />
<br />
' input<br />
arrObjects = Rhino.GetObjects("select vector field")<br />
arrAttract = Rhino.GetObjects("select point attractors", 0)<br />
thresholdDist = Rhino.GetReal("distance threshold", 10, 0)<br />
scaleFactor = Rhino.GetReal("scale factor", 1, 0)<br />
<br />
' loop through each object and get the closest attractor<br />
For i = 0 To UBound(arrObjects)<br />
<br />
' get object bounding box centerpoint<br />
arrCntrPt = Rhino.CurveMidPoint(arrObjects(i))<br />
<br />
' loop through attractors to find the distance to the closest<br />
counter = 0<br />
For j = 0 To UBound(arrAttract)<br />
' get closest point - use for curves rather than points<br />
'dblParam = Rhino.CurveClosestPoint(arrAttract(j), arrCntrPt)<br />
'arrAttPt = Rhino.EvaluateCurve(arrAttract(j), dblParam)<br />
arrAttPt = Rhino.PointCoordinates(arrAttract(j))<br />
<br />
' get distance<br />
dblAttDistTest = Rhino.Distance(arrAttPt, arrCntrPt)<br />
<br />
' is it closer<br />
If counter < 1 Then<br />
dblClosestAttDist = dblAttDistTest<br />
dblClosestAtt = counter<br />
Else<br />
If dblAttDistTest < thresholdDist Then<br />
If dblAttDistTest < dblClosestAttDist Then <br />
dblClosestAttDist = dblAttDistTest<br />
dblClosestAtt = counter<br />
End If<br />
End If <br />
End If<br />
counter = counter + 1<br />
<br />
Next <br />
<br />
' if the object is within the threshold then operate on it<br />
If dblClosestAttDist < thresholdDist Then<br />
<br />
' caculate the adjustment amount<br />
adjAmount = (thresholdDist - dblClosestAttDist)/thresholdDist <br />
'adjAmount = 1 - ((thresholdDist - dblClosestAttDist)/thresholdDist) ' decrease infinite amount<br />
'adjAmount = ((thresholdDist - dblClosestAttDist)/thresholdDist) * scaleFactor + 1 ' increase by factor of up to 100% x scaleFactor<br />
<br />
' based on attractor proximity do something to the object (eg scale)<br />
<br />
' scale<br />
'Rhino.ScaleObject arrObjects(i), arrCntrPt, array(adjAmount,adjAmount,adjAmount) ' scale<br />
<br />
' change color<br />
at_ChangeColor arrObjects(i),thresholdDist,dblClosestAttDist,scaleFactor <br />
<br />
' rotate<br />
at_rotate arrObjects(i),arrAttract(dblClosestAtt),adjAmount<br />
<br />
<br />
End If<br />
<br />
Next <br />
<br />
End Sub<br />
<br />
Function at_ChangeColor(obj,tDist,aDist,sFactor)<br />
Dim objColor, newColor<br />
' caculate color<br />
newColor = 255 - ((1 - ((tDist - aDist)/tDist)) * 255) <br />
'newColor = 255<br />
' change color<br />
objColor = Rhino.ObjectColor(obj, newColor)<br />
'Rhino.print objColor<br />
' at_ChangeColor=<br />
End Function<br />
<br />
Function at_rotate(obj,attr,adj)<br />
Dim currentVec, aLoc, dirVec, currentAngle, arrAngle, diffAngle, angle, xProd, adjAngle<br />
<br />
aLoc = Rhino.PointCoordinates(attr)<br />
<br />
' get closest end on line and current direction vector<br />
If (Rhino.Distance((Rhino.CurveEndPoint(obj)), aLoc)) > (Rhino.Distance((Rhino.CurveStartPoint(obj)), aLoc)) Then<br />
currentVec = Rhino.VectorCreate((Rhino.CurveEndPoint(obj)),(Rhino.CurveStartPoint(obj)))<br />
Else<br />
currentVec = Rhino.VectorCreate((Rhino.CurveStartPoint(obj)),(Rhino.CurveEndPoint(obj)))<br />
End If<br />
<br />
' get vector to attractor<br />
<br />
dirVec = Rhino.VectorCreate((Rhino.CurveMidPoint(obj)),aLoc)<br />
<br />
' get cross product<br />
xProd = Rhino.VectorCrossProduct(currentVec,dirVec)<br />
<br />
' get angle between vectors<br />
angle = Rhino.Angle2(array(array(0,0,0),currentVec),array(array(0,0,0),dirVec))<br />
<br />
' adjust angle based on adj amount <br />
adjAngle = (adj*angle(0)) <br />
<br />
' rotate object using cross prod as axis<br />
Rhino.RotateObject obj, Rhino.CurveMidPoint(obj), adjAngle, xProd<br />
<br />
End Function<br />
<br />
<br />
<br />
<br />
<br />
[[Category:RhinoScript]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Random_Percentage_Selection-Kokkugia&diff=345
Random Percentage Selection-Kokkugia
2017-04-24T20:23:40Z
<p>Nickpisca: Created page with "http://www.kokkugia.com/wiki/scriptLibrary/rvb/randomSelect.rvb https://web-beta.archive.org/web/20101214095847/http://www.kokkugia.com/wiki/scriptLibrary/rvb/randomSelect.rv..."</p>
<hr />
<div>http://www.kokkugia.com/wiki/scriptLibrary/rvb/randomSelect.rvb<br />
<br />
https://web-beta.archive.org/web/20101214095847/http://www.kokkugia.com/wiki/scriptLibrary/rvb/randomSelect.rvb<br />
<br />
<br />
<br />
Option Explicit<br />
'------------------------------------------------------------------------------<br />
' Subroutine: randomSelect<br />
' Purpose: selection of random objects based on percentage<br />
' Author: Roland Snooks | 2007 | www.kokkugia.com<br />
'------------------------------------------------------------------------------<br />
Sub randomSelect<br />
<br />
Dim arrObjects, selPer, arrSuccess(), sCount, i<br />
<br />
' input<br />
arrObjects = Rhino.GetObjects("pick objects to randomly select from", 0)<br />
selPer = Rhino.GetReal("percentage to select", 50) <br />
<br />
' loop through each object<br />
For i = 0 To UBound(arrObjects)<br />
If (Rnd*100) <= selPer Then<br />
' add to array<br />
ReDim Preserve arrSuccess(sCount)<br />
arrSuccess(sCount) = arrObjects(i)<br />
sCount = sCount + 1<br />
End If<br />
Next <br />
<br />
Rhino.SelectObjects arrSuccess<br />
<br />
End Sub <br />
<br />
randomSelect<br />
<br />
<br />
<br />
[[Category:RhinoScript]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Copy_Object_to_Selected_Point_Locations-Kokkugia&diff=344
Copy Object to Selected Point Locations-Kokkugia
2017-04-24T20:21:38Z
<p>Nickpisca: Created page with "http://www.kokkugia.com/wiki/scriptLibrary/rvb/Copy2Pts.rvb Category:RhinoScript"</p>
<hr />
<div>http://www.kokkugia.com/wiki/scriptLibrary/rvb/Copy2Pts.rvb<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
[[Category:RhinoScript]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=AttractorToolsScale-Kokkugia&diff=343
AttractorToolsScale-Kokkugia
2017-04-24T20:20:32Z
<p>Nickpisca: Created page with "http://www.kokkugia.com/wiki/scriptLibrary/rvb/attractorToolsScale.rvb https://web-beta.archive.org/web/20080103150852/http://www.kokkugia.com/wiki/scriptLibrary/rvb/attracto..."</p>
<hr />
<div>http://www.kokkugia.com/wiki/scriptLibrary/rvb/attractorToolsScale.rvb<br />
<br />
https://web-beta.archive.org/web/20080103150852/http://www.kokkugia.com/wiki/scriptLibrary/rvb/attractorToolsScale.rvb<br />
<br />
<br />
<br />
<br />
Option Explicit<br />
'------------------------------------------------------------------------------<br />
' Subroutine: attractorToolsScale<br />
' Purpose: transforms objects based on proximity to attractors<br />
' Author: Roland Snooks | 2007 | www.kokkugia.com<br />
'------------------------------------------------------------------------------<br />
Sub attractorToolsScale<br />
<br />
Dim i, j, arrObjects, arrAttract, thresholdDist, scaleFactor, arrBBox, arrCntrPt, counter, arrAttPt <br />
Dim dblAttDistTest, dblClosestAttDist, dblClosestAtt, adjAmount<br />
<br />
' input<br />
arrObjects = Rhino.GetObjects("select objects")<br />
arrAttract = Rhino.GetObjects("select point attractors", 0)<br />
thresholdDist = Rhino.GetReal("distance threshold", 10, 0)<br />
scaleFactor = Rhino.GetReal("scale factor", 1, 0)<br />
<br />
' loop through each object and get the closest attractor<br />
For i = 0 To UBound(arrObjects)<br />
<br />
' get object bounding box centerpoint<br />
arrBBox = Rhino.BoundingBox(arrObjects(i))<br />
arrCntrPt = array((((arrBBox(2)(0)) + (arrBBox(0)(0))) / 2), (((arrBBox(2)(1)) + (arrBBox(0)(1))) / 2), (((arrBBox(0)(2)) + (arrBBox(4)(2))) / 2))<br />
<br />
' loop through attractors to find the distance to the closest<br />
counter = 0<br />
For j = 0 To UBound(arrAttract)<br />
' get closest point - use for curves rather than points<br />
'dblParam = Rhino.CurveClosestPoint(arrAttract(j), arrCntrPt)<br />
'arrAttPt = Rhino.EvaluateCurve(arrAttract(j), dblParam)<br />
arrAttPt = Rhino.PointCoordinates(arrAttract(j))<br />
<br />
' get distance<br />
dblAttDistTest = Rhino.Distance(arrAttPt, arrCntrPt)<br />
<br />
' is it closer<br />
If counter < 1 Then<br />
dblClosestAttDist = dblAttDistTest<br />
dblClosestAtt = counter<br />
Else<br />
If dblAttDistTest < thresholdDist Then<br />
If dblAttDistTest < dblClosestAttDist Then <br />
dblClosestAttDist = dblAttDistTest<br />
dblClosestAtt = counter<br />
End If<br />
End If <br />
End If<br />
counter = counter + 1<br />
<br />
Next <br />
<br />
' if the object is within the threshold then operate on it<br />
If dblClosestAttDist < thresholdDist Then<br />
<br />
' caculate the adjustment amount<br />
adjAmount = 1 - ((thresholdDist - dblClosestAttDist)/thresholdDist) ' decrease infinite amount<br />
'adjAmount = ((thresholdDist - dblClosestAttDist)/thresholdDist) * scaleFactor + 1 ' increase by factor of up to 100% x scaleFactor<br />
<br />
' based on attractor proximity do something to the object (eg scale)<br />
<br />
' scale<br />
Rhino.ScaleObject arrObjects(i), arrCntrPt, array(adjAmount,adjAmount,adjAmount) ' scale<br />
<br />
' change color<br />
at_ChangeColor arrObjects(i),thresholdDist,dblClosestAttDist,scaleFactor <br />
<br />
End If<br />
<br />
Next <br />
<br />
End Sub<br />
<br />
attractorToolsScale<br />
<br />
<br />
<br />
<br />
Function at_ChangeColor(obj,tDist,aDist,sFactor)<br />
Dim objColor, newColor<br />
' caculate color<br />
newColor = 255 - ((1 - ((tDist - aDist)/tDist)) * 255) <br />
'newColor = 255<br />
' change color<br />
objColor = Rhino.ObjectColor(obj, newColor)<br />
'Rhino.print objColor<br />
' at_ChangeColor=<br />
End Function<br />
<br />
<br />
<br />
<br />
[[Category:RhinoScript]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=User:Nickpisca&diff=342
User:Nickpisca
2017-04-24T20:16:48Z
<p>Nickpisca: Created page with "'''Nicholas Pisca<br> <font size="-2" color="red"> [http://www.nickpisca.com www.nickpisca.com]<br><br> Founder [http://www.nickpisca.com/0001d 0001d]<br> Lecturer [http://ww..."</p>
<hr />
<div>'''Nicholas Pisca<br><br />
<br />
<font size="-2" color="red"><br />
[http://www.nickpisca.com www.nickpisca.com]<br><br><br />
Founder [http://www.nickpisca.com/0001d 0001d]<br><br />
Lecturer [http://www.mat.ucsb.edu/faculty.php#npisca UCSB-Media Arts Technology]<br><br />
Wiki [[Main Page|0001d BLAST]]<br><br />
Blogger [http://www.nickpisca.com/sherpa 0001d Sherpa] <br><br />
Editor [http://www.gtwiki.org GTWiki]<br><br />
Faculty [http://arch.usc.edu/ USC] [http://www.sciarc.edu/portal/programs/graduate/mediascapes/index.html MediaSCAPES] [http://www.sciarc.edu SCIarc]<br><br />
Author "[http://stores.lulu.com/nickpisca YSYT - Maya MEL Basics for Designers]"<br><br />
Automation Manager <br />
<font color="blue">Gehry Technologies</font><br><br />
</font></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=File:Wiki1.png&diff=341
File:Wiki1.png
2017-04-24T20:15:24Z
<p>Nickpisca: </p>
<hr />
<div></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=File:BackToNP.jpg&diff=340
File:BackToNP.jpg
2017-04-24T20:14:56Z
<p>Nickpisca: </p>
<hr />
<div></div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=File:N005.png&diff=339
File:N005.png
2017-04-24T20:14:28Z
<p>Nickpisca: Flesh[]logically++Transparent cellular 3D Print model setup. Rendered in DP, populated with cells in Maya with MEL.</p>
<hr />
<div>Flesh[]logically++Transparent cellular 3D Print model setup. Rendered in DP, populated with cells in Maya with MEL.</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=File:N005sfw.jpg&diff=338
File:N005sfw.jpg
2017-04-24T20:13:45Z
<p>Nickpisca: (Flesh[]logically++Transparent cellular 3D Print model setup. Rendered in DP, populated with cells in Maya with MEL. (2))</p>
<hr />
<div>(Flesh[]logically++Transparent cellular 3D Print model setup. Rendered in DP, populated with cells in Maya with MEL. (2))</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=YSYT_Maya_MEL_Book&diff=337
YSYT Maya MEL Book
2017-04-24T20:09:22Z
<p>Nickpisca: Created page with "[http://www.lulu.com/content/5781113 YSYT - Maya MEL Basics for Designers] Description: YSYT - Maya MEL Basics for Designers is the primary scripting resource for all begi..."</p>
<hr />
<div>[http://www.lulu.com/content/5781113 YSYT - Maya MEL Basics for Designers]<br />
<br />
<br />
<br />
Description:<br />
<br />
YSYT - Maya MEL Basics for Designers is the primary scripting resource for all beginner and veteran scripters in the application Maya. This instructional manual covers the fundamentals of computer programming as well as basic modeling, animating and rendering techniques in Maya.<br />
<br />
<br />
Many of the articles on this wiki will be appended with information suggestions and page numbers from YSYT. This website and YSYT work together to explain complex MEL scripting to all designers.<br />
<br />
[[YSYT MEL Scripting Book]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=YSYT_MEL_Scripting_Book&diff=336
YSYT MEL Scripting Book
2017-04-24T20:09:06Z
<p>Nickpisca: Created page with "[http://www.lulu.com/content/5781113 YSYT - Maya MEL Basics for Designers] Description: YSYT - Maya MEL Basics for Designers is the primary scripting resource for all begi..."</p>
<hr />
<div>[http://www.lulu.com/content/5781113 YSYT - Maya MEL Basics for Designers]<br />
<br />
<br />
<br />
Description:<br />
<br />
YSYT - Maya MEL Basics for Designers is the primary scripting resource for all beginner and veteran scripters in the application Maya. This instructional manual covers the fundamentals of computer programming as well as basic modeling, animating and rendering techniques in Maya.<br />
<br />
<br />
Many of the articles on this wiki will be appended with information suggestions and page numbers from YSYT. This website and YSYT work together to explain complex MEL scripting to all designers.</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=YSYT_MEL_Book&diff=335
YSYT MEL Book
2017-04-24T20:08:51Z
<p>Nickpisca: Created page with "[http://www.lulu.com/content/5781113 YSYT - Maya MEL Basics for Designers] Description: YSYT - Maya MEL Basics for Designers is the primary scripting resource for all begi..."</p>
<hr />
<div>[http://www.lulu.com/content/5781113 YSYT - Maya MEL Basics for Designers]<br />
<br />
<br />
<br />
Description:<br />
<br />
YSYT - Maya MEL Basics for Designers is the primary scripting resource for all beginner and veteran scripters in the application Maya. This instructional manual covers the fundamentals of computer programming as well as basic modeling, animating and rendering techniques in Maya.<br />
<br />
<br />
Many of the articles on this wiki will be appended with information suggestions and page numbers from YSYT. This website and YSYT work together to explain complex MEL scripting to all designers.</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Waffle-nullthing&diff=334
Waffle-nullthing
2017-04-24T20:08:35Z
<p>Nickpisca: Created page with "http://www.nullthing.com/wp-content/uploads/2008/01/waffle.zip Maya Eggcrate script. Category:MEL"</p>
<hr />
<div>http://www.nullthing.com/wp-content/uploads/2008/01/waffle.zip<br />
<br />
Maya Eggcrate script.<br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=VB_Error_Message_Guide&diff=333
VB Error Message Guide
2017-04-24T20:08:09Z
<p>Nickpisca: Created page with "__TOC__ === Method 'GetImpl' of Object 'ArcFactoryManager' failed === 1.) Line geometry driver may be non-connex. === Method 'AddWall' of object 'ArcFactoryManager' failed..."</p>
<hr />
<div>__TOC__<br />
<br />
<br />
<br />
=== Method 'GetImpl' of Object 'ArcFactoryManager' failed ===<br />
1.) Line geometry driver may be non-connex.<br />
<br />
=== Method 'AddWall' of object 'ArcFactoryManager' failed ===<br />
1.) Support geometry may not be updated, may be non-connex or invalid.<br />
<br />
=== Object doesn't support this property of method ===<br />
===== On ArcSlabs =====<br />
When updating the "thickness," the value property does not appear in the autoformatting. Users must input "Value" in manually.</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Turtle-nullthing&diff=332
Turtle-nullthing
2017-04-24T20:07:54Z
<p>Nickpisca: Created page with "http://www.nullthing.com/wp-content/uploads/2008/01/3branch.zip ''More information on recursion systems, read pages 68-84 in [http://stores.lulu.com/nickpisca YSYT]. Cat..."</p>
<hr />
<div>http://www.nullthing.com/wp-content/uploads/2008/01/3branch.zip<br />
<br />
<br />
''More information on recursion systems, read pages 68-84 in [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Traversing_Shader_Nodes&diff=331
Traversing Shader Nodes
2017-04-24T20:07:38Z
<p>Nickpisca: Created page with "Test Category:MEL"</p>
<hr />
<div>Test<br />
<br />
<br />
<br />
<br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Table-nullthing&diff=330
Table-nullthing
2017-04-24T20:06:36Z
<p>Nickpisca: Created page with "http://www.nullthing.com/wp-content/uploads/2008/01/table1.zip Category:MEL"</p>
<hr />
<div>http://www.nullthing.com/wp-content/uploads/2008/01/table1.zip<br />
<br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Surface_Relaxation_(Similar_to_Cloth)-ResearchNodes&diff=329
Surface Relaxation (Similar to Cloth)-ResearchNodes
2017-04-24T20:05:49Z
<p>Nickpisca: Created page with "http://researchnodes.org/doku.php?id=examples:surfacerelaxation.mel /* This script is a simple attempt in trying to simulate the behaviour of surfaces in membrane s..."</p>
<hr />
<div>http://researchnodes.org/doku.php?id=examples:surfacerelaxation.mel<br />
<br />
<br />
<br />
<br />
/*<br />
<br />
This script is a simple attempt in trying to simulate the behaviour of surfaces in membrane<br />
structures.<br />
It uses the "polyAverageVertex" command to relax a surface in this case a mesh. At each iteration,<br />
vertices are moved towards the average of its immediate neighbours.<br />
<br />
Select the vertices of a mesh where you want the mesh to be attached to a support then run the script.<br />
<br />
Example:<br />
<br />
relaxPolygon(100);<br />
<br />
The value in parentheses is the number of iterations of the average operation. The script creates a<br />
duplicate without inputs of the original mesh then and applies the polyAverageVertex command<br />
the defined number of times on the duplicate.<br />
<br />
Author: Tobias Schwinn<br />
http://www.tobesch.de<br />
<br />
Last update: Apr 30, 2007<br />
Version: 1.1<br />
<br />
Change Log: <br />
07/04/30: got rid of the $VertexList[] variable to use a selection of vertices as input instead;<br />
07/04/29: turned construction history off to avoid the creation of hundreds of polyAverage nodes;<br />
also created the duplicate without inputs in order to allow -ch 0 in polyAverage;<br />
<br />
<br />
*/<br />
<br />
proc relaxPolygon(int $numIt){<br />
<br />
string $list[];<br />
string $dObj[];<br />
<br />
// simple surface relaxation<br />
<br />
// check if vertices are selected, then if the selected object is a polygon mesh <br />
//$list = `ls -sl -dag -leaf`; <br />
$list = `ls -sl`;<br />
select -cl;<br />
<br />
if(size($list)==0)<br />
error "Please select at least one Polygon!";<br />
<br />
// get the name of the mesh containing the vertex<br />
string $item[] = stringToStringArray($list[0], ".");<br />
<br />
// duplicate the item<br />
$dObj = `duplicate -rr -n ("d" + $item[0]) $item[0]`;<br />
hide $list[0];<br />
<br />
// get the number of vertices used in the mesh<br />
int $vertexCount[] = `polyEvaluate -v $dObj[0]`; <br />
<br />
// invert selection<br />
string $currVertex[]; <br />
for ( $vertex in $list ){<br />
$currVertex = stringToStringArray($vertex, ".");<br />
select -tgl ($dObj[0] + "." + $currVertex[1]) ;<br />
}<br />
select -tgl ($dObj[0] + ".vtx[0:" + $vertexCount[0] + "]") ;<br />
<br />
for( $i=0;$i<$numIt;$i++){<br />
polyAverageVertex -iterations 1 -ws 0 -ch 0 ;<br />
refresh();<br />
}<br />
select -r $dObj;<br />
<br />
}<br />
<br />
relaxPolygon(100);<br />
<br />
<br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Stp.dll_DLLImport&diff=328
Stp.dll DLLImport
2017-04-24T20:04:27Z
<p>Nickpisca: Created page with " #region // dll setup data [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern int InitStp(); [DllImport("s..."</p>
<hr />
<div> #region // dll setup data<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern int InitStp();<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern bool RunMotor1(<br />
int steps,<br />
int interval,<br />
int direction,<br />
int outputs<br />
);<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern bool RunMotor2(<br />
int steps,<br />
int interval,<br />
int direction,<br />
int outputs<br />
);<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern bool StopMotor1(<br />
int outputs);<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern bool StopMotor2(<br />
int outputs);<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern bool SetStepMode(<br />
int M1Mode,<br />
int M2Mode);<br />
[DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]<br />
public static extern bool GetCurrentStatus(<br />
out int M1Active,<br />
out int M2Active,<br />
out int M1Steps,<br />
out int M2Steps,<br />
out int Inputs);<br />
#endregion<br />
<br />
<br />
<br />
This C# code I wrote is based on the VB code located on the PC-Controls stepper controller documentation: [https://www.pc-control.co.uk/images/StepperBee%20manual.pdf PC-Controls Docs]<br />
<br />
''Unrelated MEL scripting help located here: [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:CSharp]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Spiral-nullthing&diff=327
Spiral-nullthing
2017-04-24T20:04:10Z
<p>Nickpisca: Created page with "http://www.nullthing.com/wp-content/uploads/2008/06/spiral.zip ''More information on working with multiple shaders, read pages 128-133 in [http://stores.lulu.com/nickpisca Y..."</p>
<hr />
<div>http://www.nullthing.com/wp-content/uploads/2008/06/spiral.zip<br />
<br />
<br />
''More information on working with multiple shaders, read pages 128-133 in [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Spheriolithography&diff=326
Spheriolithography
2017-04-24T20:03:50Z
<p>Nickpisca: Created page with "<div align="right">Back to Academic_Archives.</div> __TOC__ === History === Spheriolithography is a rapid prototyping file preparation technique invented and developed by..."</p>
<hr />
<div><div align="right">Back to [[Academic_Archives]].</div><br />
__TOC__<br />
<br />
=== History ===<br />
Spheriolithography is a rapid prototyping file preparation technique invented and developed by Nick Pisca. It involves taking a driver geometry, like a NURBS Surface or polygon, and populate the surface with an even density of merged spheres. Pisca has developed several scripts in different platforms to accomplish this task.<br />
<br />
<br />
=== Interpolation ===<br />
The process requires an algorithm to determine the polygon count or UV count and to interpolate between the principle variables. Depending upon the output file type, users can automate the colorization of each individual cell, or use a universal color for the entire aggregation. Fitness criteria for instantiated aggregation are (1) distance to neighbors, (2) approximation from surface, and (3) gaps in the merging. <br />
<br />
<br />
=== Advantages and Disadvantages ===<br />
''Advantages:'' <br><br />
*Ability to print any complex self-intersecting surface<br><br />
*Promotes a cellular aesthetic<br><br />
*Can produce multiple colors per driver surface<br><br />
''Disadvantages:'' <br><br />
*File sizes can be large, even without facet optimization<br><br />
*Difficult to achieve smoothing without large cell counts<br><br />
*May require lengthy calculation times<br><br />
*May require 64-bit or heavy processing<br><br />
<br />
<br />
=== Pertinent Links ===<br />
[[CNC Technology]]<br />
<br />
<br />
=== Posted Projects ===<br />
'''MEL Scripts'''<br />
<br />
''Construction functions''<br />
* [[IsVectorInArrayWithinDistance]]<br />
* [[ApplyColorToObject]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SpherePack-nullthing&diff=325
SpherePack-nullthing
2017-04-24T20:03:33Z
<p>Nickpisca: Created page with "http://www.nullthing.com/wp-content/uploads/2008/07/spherepack.zip ''More information on working with spheres, read pages 43-54 in [http://stores.lulu.com/nickpisca YSYT]...."</p>
<hr />
<div>http://www.nullthing.com/wp-content/uploads/2008/07/spherepack.zip<br />
<br />
<br />
''More information on working with spheres, read pages 43-54 in [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SpaceFrameSurface-ctrl-i&diff=324
SpaceFrameSurface-ctrl-i
2017-04-24T20:02:45Z
<p>Nickpisca: Created page with "http://crtl-i.com/blog/?p=140 // // Script written by Howard Jiho Kim | kimjiho@gmail.com | crtl-i.com | 2007 // // ex. // spFrSurface(srfName1, srfName2, U, V) // sp..."</p>
<hr />
<div>http://crtl-i.com/blog/?p=140<br />
<br />
<br />
<br />
//<br />
// Script written by Howard Jiho Kim | kimjiho@gmail.com | crtl-i.com | 2007<br />
//<br />
// ex.<br />
// spFrSurface(srfName1, srfName2, U, V)<br />
// spFrSurface(“nurbsPlane1”, “nurbsPlane2”, 10, 10)<br />
//<br />
<br />
// HORIZONTAL MEMBERS!!<br />
<br />
global proc spFrSurface(string $nurb, string $nurb2, int $u, int $v)<br />
{<br />
gridSurface($nurb, $u,$v);<br />
gridSurface($nurb2, $u,$v);<br />
<br />
float $u_inc = 1.0/$u;<br />
float $v_inc = 1.0/$v;<br />
float $cv[], $cv2[], $cv3[];<br />
<br />
float $i2, $k2;<br />
<br />
// get U information<br />
<br />
$u = $u + 1;<br />
$v = $v + 1;<br />
<br />
for($i=0;$i<$u;$i++)<br />
{<br />
for($k=0;$k<$v;$k++)<br />
{<br />
<br />
$i2 = $u_inc * $i;<br />
print (“u:” + $i2 + ” | “);<br />
$k2 = $v_inc * $k;<br />
print (“v:” + $k2 + ” | “);<br />
$cv = `pointOnSurface -u $i2 -v $k2 -position $nurb`;<br />
print( $cv[0] +” “+ $cv[1] +” “+ $cv[2] + ” | “);<br />
<br />
$cv2 = `pointOnSurface -u $i2 -v $k2 -position $nurb2`;<br />
print( $cv2[0] +” “+ $cv2[1] +” “+ $cv2[2] +”\n”);<br />
<br />
curve -d 1 -p $cv[0] $cv[1] $cv[2] -p $cv2[0] $cv2[1] $cv2[2] -k 0 -k 1;<br />
<br />
// print CV<br />
<br />
//$x[$k] = $cv[0];<br />
//$y[$k] = $cv[1];<br />
//$z[$k] = $cv[2];<br />
<br />
}<br />
<br />
//$curveName[$i] = `curve -p $x[0] $y[0] $z[0] -p $x[1] $y[1] $z[1] -p $x[2] $y[2] $z[2] -p $x[3] $y[3] $z[3] -p $x[4] $y[4] $z[4] -p $x[5] $y[5] $z[5] -p $x[6] $y[6] <br />
$z[6] -p $x[7] $y[7] $z[7]`;<br />
}<br />
}<br />
<br />
// LONGITUDINAL MEMBERS<br />
global proc gridSurface(string $nurb, int $u, int $v)<br />
{<br />
float $u_inc = 1.0/$u;<br />
float $v_inc = 1.0/$v;<br />
float $cv[], $cv2[], $cv3[];<br />
<br />
float $i2, $k2;<br />
<br />
// get U information<br />
<br />
$u = $u + 1;<br />
<br />
for($i=0;$i<$u;$i++)<br />
{<br />
for($k=0;$k<$v;$k++)<br />
{<br />
<br />
$i2 = $u_inc * $i;<br />
print (“u:” + $i2 + ” | “);<br />
$k2 = $v_inc * $k;<br />
print (“v:” + $k2 + ” | “);<br />
$cv = `pointOnSurface -u $i2 -v $k2 -position $nurb`;<br />
print( $cv[0] +” “+ $cv[1] +” “+ $cv[2] + ” | “);<br />
<br />
$k3 = $v_inc * ($k+1); <br />
<br />
$cv2 = `pointOnSurface -u $i2 -v $k3 -position $nurb`;<br />
print( $cv2[0] +” “+ $cv2[1] +” “+ $cv2[2] +”\n”);<br />
<br />
curve -d 1 -p $cv[0] $cv[1] $cv[2] -p $cv2[0] $cv2[1] $cv2[2] -k 0 -k 1;<br />
<br />
// print CV<br />
<br />
//$x[$k] = $cv[0];<br />
//$y[$k] = $cv[1];<br />
//$z[$k] = $cv[2];<br />
<br />
}<br />
<br />
//$curveName[$i] = `curve -p $x[0] $y[0] $z[0] -p $x[1] $y[1] $z[1] -p $x[2] $y[2] $z[2] -p $x[3] $y[3] $z[3] -p $x[4] $y[4] $z[4] -p $x[5] $y[5] $z[5] -p $x[6] $y[6] <br />
$z[6] -p $x[7] $y[7] $z[7]`;<br />
}<br />
<br />
// get U information<br />
<br />
$v = $v + 1;<br />
$u = $u – 1;<br />
<br />
for($i=0;$i<$v;$i++)<br />
{<br />
for($k=0;$k<$u;$k++)<br />
{<br />
<br />
$i2 = $u_inc * $k;<br />
print (“u:” + $i2 + ” | “);<br />
$k2 = $v_inc * $i;<br />
print (“v:” + $k2 + ” | “);<br />
$cv = `pointOnSurface -u $i2 -v $k2 -position $nurb`;<br />
print( $cv[0] +” “+ $cv[1] +” “+ $cv[2] + ” | “);<br />
<br />
$i3 = $u_inc * ($k+1);<br />
<br />
$cv2 = `pointOnSurface -u $i3 -v $k2 -position $nurb`;<br />
print( $cv2[0] +” “+ $cv2[1] +” “+ $cv2[2] +”\n”);<br />
<br />
curve -d 1 -p $cv[0] $cv[1] $cv[2] -p $cv2[0] $cv2[1] $cv2[2] -k 0 -k 1;<br />
<br />
// print CV<br />
<br />
//$x[$k] = $cv[0];<br />
//$y[$k] = $cv[1];<br />
//$z[$k] = $cv[2];<br />
<br />
}<br />
<br />
//$curveName[$i] = `curve -p $x[0] $y[0] $z[0] -p $x[1] $y[1] $z[1] -p $x[2] $y[2] $z[2] -p $x[3] $y[3] $z[3] -p $x[4] $y[4] $z[4] -p $x[5] $y[5] $z[5] -p $x[6] $y[6] <br />
$z[6] -p $x[7] $y[7] $z[7]`;<br />
}<br />
}<br />
<br />
<br />
<br />
''More information on isoparm manipulation, read pages 109-113 in [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SmartTime&diff=323
SmartTime
2017-04-24T20:00:54Z
<p>Nickpisca: Created page with " static string SmartTime(int Num_in_ms) { //Nick Pisca 0001d 2015 if (Num_in_ms < 1000) { return "< 1 sec";..."</p>
<hr />
<div> <br />
static string SmartTime(int Num_in_ms)<br />
{ <br />
//Nick Pisca 0001d 2015<br />
if (Num_in_ms < 1000)<br />
{<br />
return "< 1 sec";<br />
}<br />
double Num_in_sec = Num_in_ms / 1000.0;<br />
if (Num_in_sec < 60)<br />
{<br />
double NS = Math.Round(Num_in_sec, 2);<br />
return (NS.ToString() + " seconds");<br />
}<br />
double Num_in_min = Num_in_sec / 60.0;<br />
double Mins = Math.Round(Num_in_min, 0);<br />
double SecFract = Num_in_min - Mins;<br />
double Secs = Math.Round(SecFract * 60.0, 2);<br />
return Mins + " mins, " + Secs + " secs";<br />
}<br />
<br />
<br />
<br />
<br />
''Unrelated MEL scripting help located here: [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:CSharp]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SmartRun&diff=322
SmartRun
2017-04-24T19:59:47Z
<p>Nickpisca: Created page with " static int SmartRun(int Motor_Num, int Num_Steps, int Interval_in_ms, int Forward0_Backward1, int outputBinary) { //Nick Pisca 0001d 2015..."</p>
<hr />
<div> static int SmartRun(int Motor_Num, int Num_Steps, int Interval_in_ms, <br />
int Forward0_Backward1, int outputBinary)<br />
{<br />
//Nick Pisca 0001d 2015<br />
// outputBinary:<br />
// integer in the range 0 to 7 corresponding to the bit pattern for on/off of the <br />
// additional switching outputs associated with motor 1. e.g. a value of 5 (which <br />
// is 00000101 in binary) would result in outputs 1 and 3 being on.<br />
try<br />
{<br />
bool RM = false;<br />
if (Motor_Num == 1)<br />
{<br />
RM = RunMotor1(Num_Steps, Interval_in_ms, Forward0_Backward1, outputBinary);<br />
}<br />
else<br />
{<br />
RM = RunMotor2(Num_Steps, Interval_in_ms, Forward0_Backward1, outputBinary);<br />
}<br />
Console.Write("Proc: Motor" + Motor_Num + ", steps:" + Num_Steps + ", int:" + <br />
Interval_in_ms + ". (time:" + [[SmartTime]](Num_Steps * Interval_in_ms) + ")\n");<br />
Thread.Sleep(Num_Steps * Interval_in_ms);<br />
}<br />
catch <br />
{<br />
if (Motor_Num == 1)<br />
{<br />
StopMotor1(outputBinary);<br />
}<br />
else<br />
{<br />
StopMotor2(outputBinary);<br />
}<br />
}<br />
return 0;<br />
}<br />
<br />
<br />
<br />
<br />
''Unrelated MEL scripting help located here: [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:CSharp]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SelectElement3_Values&diff=321
SelectElement3 Values
2017-04-24T19:59:06Z
<p>Nickpisca: Created page with "Values to use as selection filter. Role: Values which can be given as filter to Selection.SelectElement2, Selection.SelectElement3, Selection.IndicateOrSelectElement2D or Sele..."</p>
<hr />
<div>Values to use as selection filter.<br />
Role: Values which can be given as filter to Selection.SelectElement2, Selection.SelectElement3, Selection.IndicateOrSelectElement2D or Selection.IndicateOrSelectElement3D, beside the automation object names.<br />
Values:<br />
<br />
ZeroDim<br />
Topological 0-D entity (such as a Point2D )<br />
<br />
MonoDim<br />
Topological 1-D entity which cannot be infinite (such as a HybridShapeSpline)<br />
<br />
MonoDimInfinite<br />
Topological 1-D entity which may be infinite, such as a HybridShapeSpline (not infinite) or a HybridShapeLinePtDir for which a call to HybridShapeLinePtDir.GetLengthType would give 1, 2 or 3 (infinite)<br />
<br />
RectilinearMonoDim<br />
1-D entity which cannot be infinite, the entity having a rectilinear geometry<br />
<br />
RectilinearMonoDimInfinite<br />
1-D entity which may be infinite, the entity having a rectilinear geometry<br />
<br />
BiDim<br />
Topological 2-D entity which cannot be infinite (such as a HybridShapeCylinder )<br />
<br />
BiDimInfinite<br />
Topological 2-D entity which may be infinite, such as a HybridShapeCylinder (non infinite) or a HybridShapePlaneOffsetPt (infinite)<br />
<br />
PlanarBiDim<br />
2-D entity which cannot be infinite, the entity having a planar geometry<br />
<br />
PlanarBiDimInfinite<br />
2-D entity having a planar geometry<br />
<br />
CylindricalBiDim<br />
2-D entity which cannot be infinite, the entity having a cylindrical geometry<br />
<br />
TriDim<br />
Topological 3-D entity (such as a Pad ) <br />
<br />
<br />
<br />
Thanks to this forum post: http://www.catiav5forum.de/wbb3/wbb/index.php?page=Thread&threadID=2167&l=4</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SelSurfDup&diff=320
SelSurfDup
2017-04-24T19:58:46Z
<p>Nickpisca: Created page with " Sub SelSurfDup(SurfArr As Variant) Dim SecArr() ReDim SecArr(0) For X = 0 To UBound(SurfArr) If HasArea(SurfArr(X)) Then Dim CMeas Set CMeas = The..."</p>
<hr />
<div> Sub SelSurfDup(SurfArr As Variant)<br />
Dim SecArr()<br />
ReDim SecArr(0)<br />
<br />
For X = 0 To UBound(SurfArr)<br />
If HasArea(SurfArr(X)) Then<br />
Dim CMeas<br />
Set CMeas = TheSPAWorkbench.GetMeasurable(SurfArr(X))<br />
Dim CPerimeter As Double<br />
CPerimeter = CMeas.Perimeter<br />
Dim CArea As Double<br />
CArea = CMeas.Area<br />
Dim CCOG(2)<br />
CMeas.GetCOG CCOG<br />
<br />
For Y = X + 1 To UBound(SurfArr)<br />
If HasArea(SurfArr(Y)) Then<br />
Dim NMeas<br />
Set NMeas = TheSPAWorkbench.GetMeasurable(SurfArr(Y))<br />
Dim NPerimeter As Double<br />
NPerimeter = NMeas.Perimeter<br />
Dim NArea As Double<br />
NArea = NMeas.Area<br />
Dim NCOG(2)<br />
NMeas.GetCOG NCOG<br />
<br />
If NPerimeter = CPerimeter And CArea = NArea And NCOG(0) = CCOG(0) And NCOG(1) = CCOG(1) And NCOG(2) = CCOG(2) Then<br />
Set SecArr(UBound(SecArr)) = SurfArr(Y)<br />
ReDim Preserve SecArr(UBound(SecArr) + 1)<br />
End If<br />
End If<br />
Next Y<br />
End If<br />
Next X <br />
<br />
For Z = 0 To UBound(SecArr) - 1<br />
MyHSFactory.DeleteObjectForDatum SecArr(Z)<br />
Next Z<br />
End Sub<br />
<br />
<br />
<br />
[[Category:CATIA DP VB]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=SafeArrayDelete_MEL&diff=319
SafeArrayDelete MEL
2017-04-24T19:58:22Z
<p>Nickpisca: Created page with " //0001D LLC 2016 Nick Pisca (c) //Why? Sometimes deleting 100,000's of objects will crash Maya. This is safer. string $ll[] = `ls -tr "NM_*_*"`; int $ct = size($ll); f..."</p>
<hr />
<div><br />
//0001D LLC 2016 Nick Pisca (c)<br />
//Why? Sometimes deleting 100,000's of objects will crash Maya. This is safer.<br />
string $ll[] = `ls -tr "NM_*_*"`;<br />
int $ct = size($ll);<br />
for ($x=0;$x<$ct;$x++) {<br />
print ("Deleting Object Name: "+$ll[$x]+"\n");<br />
delete $ll[$x];<br />
}<br />
<br />
<br />
<br />
<br />
<br />
''More information on vectors and arrays, read pages 12-16 in [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Rotate_Objects_by_Concatenation&diff=318
Rotate Objects by Concatenation
2017-04-24T19:58:08Z
<p>Nickpisca: Created page with " for ($x = 1; $x<91; $x++){ currentTime 1 setKeyframe -breakdown 0 ("nurbsSphere"+$x+".rotate"); currentTime 260 ; setKeyframe -breakdown 0 ("nurbsSphere"+$x+".rotate");..."</p>
<hr />
<div> for ($x = 1; $x<91; $x++){<br />
<br />
currentTime 1<br />
setKeyframe -breakdown 0 ("nurbsSphere"+$x+".rotate");<br />
currentTime 260 ;<br />
setKeyframe -breakdown 0 ("nurbsSphere"+$x+".rotate");<br />
<br />
float $randx = rand(-360,360);<br />
float $randy = rand(-180,560);<br />
float $randz = rand(-555,760);<br />
<br />
rotate -r -os $randx $randy $randz ;<br />
}<br />
<br />
<br />
''More information on attribute keyframing, read pages 119-122 in [http://stores.lulu.com/nickpisca YSYT].<br />
<br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=Right_MEL&diff=317
Right MEL
2017-04-24T19:57:39Z
<p>Nickpisca: Created page with " global proc string Right(string $Input, int $Num) { //Nick Pisca + Ralph Levinson 0001d 2013 //string $Input = "testing"; int $Num = 2; int $Length = size($Input); in..."</p>
<hr />
<div> global proc string Right(string $Input, int $Num) {<br />
//Nick Pisca + Ralph Levinson 0001d 2013<br />
//string $Input = "testing"; int $Num = 2;<br />
int $Length = size($Input);<br />
int $Stump = $Length - $Num + 1;<br />
string $Val = `substring $Input $Stump $Length`; <br />
return $Val;<br />
}<br />
<br />
<br />
<br />
<br />
''More information on strings and arrays, read pages 28-37 in [http://stores.lulu.com/nickpisca YSYT]. <br />
<br />
[[Category:MEL]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=RevitVBNETReturnTotalRows&diff=316
RevitVBNETReturnTotalRows
2017-04-24T19:57:21Z
<p>Nickpisca: Created page with " Function ReturnTotalRows(ByVal CurCells As Range) As Integer Dim RowCounter As Integer = 1 Dim FileCheck As Boolean = False While RowCounter <..."</p>
<hr />
<div> Function ReturnTotalRows(ByVal CurCells As Range) As Integer<br />
Dim RowCounter As Integer = 1<br />
Dim FileCheck As Boolean = False<br />
While RowCounter < 1000 And FileCheck = False<br />
FileCheck = True<br />
For colcounter = 1 To 15<br />
If CStr(CurCells(RowCounter, colcounter).value) <> "" Then<br />
FileCheck = False<br />
End If<br />
Next colcounter<br />
RowCounter = RowCounter + 1<br />
End While<br />
ReturnTotalRows = RowCounter<br />
End Function<br />
<br />
<br />
<br />
[[Category:Revit VB.NET]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=RevitVBNETOpenExcel&diff=315
RevitVBNETOpenExcel
2017-04-24T19:57:07Z
<p>Nickpisca: Created page with " Imports MsExcel = Microsoft.Office.Interop.Excel Partial Class ThisDocument Public Sub OpenExcel() Dim excel As MsExcel.Application = New MsExcel.ApplicationCl..."</p>
<hr />
<div> Imports MsExcel = Microsoft.Office.Interop.Excel<br />
Partial Class ThisDocument<br />
Public Sub OpenExcel()<br />
Dim excel As MsExcel.Application = New MsExcel.ApplicationClass()<br />
If (excel Is Nothing) Then<br />
MsgBox("Failed to get or start Excel!?")<br />
End If<br />
excel.Visible = True<br />
Dim workbook As MsExcel.Workbook = excel.Workbooks.Add '.new '.Open(dlgFileXLS.FileName)<br />
Dim worksheet As MsExcel.Worksheet = workbook.ActiveSheet<br />
End Sub<br />
End Class<br />
<br />
<br />
<br />
[[Category:Revit VB.NET]]</div>
Nickpisca
http://nickpisca.com/BLAST/index.php?title=ReturnRandomVector&diff=314
ReturnRandomVector
2017-04-24T19:56:52Z
<p>Nickpisca: Created page with " global proc vector returnRandomVector(float $Lower, float $Higher) { //Author Nick Pisca 0001d 2009 float $XVal = rand($Lower, $Higher); float $YVal = rand($Lower, $Higher..."</p>
<hr />
<div> global proc vector returnRandomVector(float $Lower, float $Higher) {<br />
//Author Nick Pisca 0001d 2009<br />
float $XVal = rand($Lower, $Higher);<br />
float $YVal = rand($Lower, $Higher);<br />
float $ZVal = rand($Lower, $Higher);<br />
vector $CAPVec = <<$XVal, $YVal, $ZVal>>;<br />
return $CAPVec;<br />
}<br />
<br />
<br />
''More information on vectors and vector mathematics, read pages 14-16, 20-21 in [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:MEL]]</div>
Nickpisca