This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn GenerateRandomPointsOnSurface theObj PointCount useIntersection:true numAttempts:10 = | |
( | |
delete $Teapot* --delete previous teapots (remove if you are not making teapots) | |
local st = timestamp() --get the start time | |
seed 12345 --set the random seed to a static number to get the same distribution each run | |
local theMesh = snapshotasMesh theObj --snapshot the TriMesh of the object | |
local theCount = theMesh.numfaces --get the number of faces in the TriMesh | |
local theNewObjectsArray = #() --init. an array for the objects to create | |
local theArea = 0 --init. a variable to hold the count. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- length = 12.6 | |
-- radius = 10 | |
-- angle 72 | |
-- get arc length | |
arcLength = 2*pi*10*(72.0/360.0) | |
-- get arc angle | |
arcAngle = 360.0 * (2.0/10.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- delete objects | |
-- for y = -10 to 10 do | |
-- ( | |
-- for x = -10 to 10 do | |
-- ( | |
-- b = box width:5 height:1 length:5 | |
-- b.pos = [x*5,y*5,0] | |
-- ) | |
-- ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CA = attributes MyData | |
( | |
parameters main | |
( | |
theNames type:#stringTab tabSizeVariable:true | |
nodes type:#nodeTab tabSizeVariable:true | |
) | |
) | |
--// variant #1 > add to rootNode to store with file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn GetCenter pts = | |
( | |
local center = [0,0,0] | |
minPt = copy pts[1] | |
maxPt = copy pts[1] | |
for p in pts do | |
( | |
/* Find the min pt3 values */ | |
if p.x < minPt.x do minPt.x = p.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete objects | |
theV = normalize [5,0,10] --the vector to rotate, normalized to unit vector | |
theStep = 180 --the step by which you want to rotate --rotate from 0 to 360-theStep with step TheStep: | |
for a = 0 to 360-theStep by theStep do | |
( | |
rm = rotateZMatrix a --create a rotation matrix from the value | |
theRotV = theV * rm --transform the original vector using the matrix | |
format "%: %\n" a theRotV --print the result to Listener | |
c = cylinder() --create a cylinder | |
c.dir = theRotV --orient along the vector to see what it looks like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region privates properties | |
#endregion privates properties | |
#region public properties | |
#endregion public properties | |
#region constructors | |
#endregion | |
#region commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// X Symbol | |
<Path Data="M0,0 L1,1 M0,1 L1,0" Stretch="Uniform" Stroke="Red" /> | |
// Arrow Right | |
<Path Data="M4.12,0 L9.67,5.47 L4.12,10.94 L0,10.88 L5.56,5.47 L0,0.06" Stretch="Uniform" Fill="Red"/> | |
// Three Dots | |
<Path Data="M12.5,6.5 C12.5,9.8137085 9.8137085,12.5 6.5,12.5 C3.1862915,12.5 0.5,9.8137085 0.5,6.5 C0.5,3.1862915 3.1862915,0.5 6.5,0.5 C9.8137085,0.5 12.5,3.1862915 12.5,6.5 z M30.5,6.5 C30.5,9.8137085 27.813708,12.5 24.5,12.5 C21.186292,12.5 18.5,9.8137085 18.5,6.5 C18.5,3.1862915 21.186292,0.5 24.5,0.5 C27.813708,0.5 30.5,3.1862915 30.5,6.5 z M48.5,6.5 C48.5,9.8137085 45.813708,12.5 42.5,12.5 C39.186292,12.5 36.5,9.8137085 36.5,6.5 C36.5,3.1862915 39.186292,0.5 42.5,0.5 C45.813708,0.5 48.5,3.1862915 48.5,6.5 z" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="13" Margin="23.75,21.75,0,0" Stretch="Fill" Stroke="Black" VerticalAlignment="Top" Width="49"/> | |
// Paper Airplane |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ICommand deleteContactCommand; | |
public ICommand DeleteContactCommand | |
{ | |
get | |
{ | |
return deleteContactCommand ?? (deleteContactCommand = new RelayCommand<Contact>(ExecuteDeleteContact)); | |
} | |
} | |
private ICommand deleteSelectedContactsCommand; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
epoly = convertToPoly (editable_mesh name:(uniquename "EPoly")) |