Get Size: Difference between revisions

no edit summary
(Created page with "Outputs the size of an object as min and max. If the inputs are left unwired, outputs the size of the world. It's important to note, it measures the size based on the number of cubic "block spaces" the object occupies in the level editor, **not** the actual number of filled-in voxels. So an 8x8x8 cube of voxels (completely filling one block space) and a tiny 1x1x1 cube of voxels (a single voxel) will both show the same size of (-0.5, -0.5, -0.5) min and (0.5, 0.5, 0.5)...")
 
No edit summary
Line 1: Line 1:
{{Block
|image=Get Size.png
|type=s
|folder=objects
|input1={{Port|o}}
|output1={{Port|v|Min}}
|output2={{Port|v|Max}}
}}
Outputs the size of an object as min and max.
Outputs the size of an object as min and max.
If the inputs are left unwired, outputs the size of the world.
If the inputs are left unwired, outputs the size of the world.


It's important to note, it measures the size based on the number of cubic "block spaces" the object occupies in the level editor, **not** the actual number of filled-in voxels. So an 8x8x8 cube of voxels (completely filling one block space) and a tiny 1x1x1 cube of voxels (a single voxel) will both show the same size of (-0.5, -0.5, -0.5) min and (0.5, 0.5, 0.5) max.  
== Notes ==
* The size output is based on the number of cubic "block spaces" the object occupies in the level editor, '''not''' the actual number of filled-in voxels.  
: So an 8x8x8 cube of voxels (completely filling one block space) and a tiny 1x1x1 cube of voxels (a single voxel) will both show the same size of (-0.5, -0.5, -0.5) min and (0.5, 0.5, 0.5) max.  


[[width=336px|/uploads/Get Size.png]]
* By default, the Get Size block outputs the volumetric size of an object (the distances from the center to the edges):


By default, the Get Size block outputs the volumetric size of an object (the distances from the center to the edges).
: [[File:Get size example1.png|thumb|none|Volumetric size]]


[[File:Screenshot_20191230_140014_com.martinmagni.fancade.png]]
: To get the geometric size of an object (the total distance from one edge to the other) use this simple method:
: [[File:Get size example2.png|thumb|none|Geometric size]]


To get the geometric size of an object (the total distance from one edge to the other) use this simple method.
[[File:Screenshot_20191230_135920_com.martinmagni.fancade.png]]




[[Category:Blocks]]
[[Category:Blocks]]