This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
sample_geometry [2018/01/24 16:10] 185.62.108.185 |
sample_geometry [2018/01/24 18:19] (current) 89.103.122.186 |
||
---|---|---|---|
Line 48: | Line 48: | ||
</code> | </code> | ||
This creates a truncated cone placed at xy position of 200, 200, with height of 50 voxels and base radius of 30 voxels and top radius of 15 voxels, filled by material of index equal to 3. | This creates a truncated cone placed at xy position of 200, 200, with height of 50 voxels and base radius of 30 voxels and top radius of 15 voxels, filled by material of index equal to 3. | ||
+ | |||
+ | |||
+ | As an example of multiple entries like the above ones we show here a Paraview visualisation of the mat.vtk file that is generated after you load the vector geometry. Using the following input file: | ||
+ | <code> | ||
+ | 4 50 50 50 20 2 | ||
+ | 7 150 50 50 150 50 80 20 2 | ||
+ | 107 50 150 90 50 150 50 20 2 | ||
+ | 108 150 150 80 150 150 50 15 35 2 | ||
+ | 8 0 0 0 200 200 50 3 | ||
+ | </code> | ||
+ | |||
+ | we got the following output. Note that the sphere is immersed into the substrate, so it looks as only a halfsphere. | ||
+ | |||
+ | {{ :objects.png?400 |}} | ||
+ | |||
+ | |||
+ | As the voxel based mesh features the staircasing effect, we need to handle the surface normal calculation carefully, while evaluating interaction of the ray with the object. Use of some particular method is chosen in the main parameter file, using e.g. this command | ||
+ | |||
+ | <code> | ||
+ | INTERFACE_METHOD | ||
+ | 3 | ||
+ | </code> | ||
+ | |||
+ | which sets the crudest method significantly affected by staircasing. | ||
+ | |||
+ | There are different surface normal evaluation methods implemented: if we use 0 as the above command parameter, simple weighting of the pixel neighbourhood is used. Regime 1 means something more advanced, however again based on weighting of the amount of material around the pixel where we do the evaluation. Regime 2 is most resistant to staircasing, being based on pre-calculation of local neighbourhood gradient and then using this information as shown in the figure below. Finally, regime 3 means only local evaluation, searching for adjacent voxels and should be used only for rectangular objects. | ||
+ | |||
+ | If the gradient based control method is used, it can be controlled further by local averaging area selection, using e.g. this directive: | ||
+ | <code> | ||
+ | AVERAGE | ||
+ | 3 | ||
+ | </code> | ||
+ | |||
+ | The provided value is typically in range of 2-5, the higher value the smoother the object boundaries are. However, too much of smoothing can also remove some fine details. Note that gradient based method is precomputing the data at the calculation start, this can affect the computation time. | ||
+ | |||
+ | {{ :normals.png?400 |}} | ||
+ | |||
+ | |||