List of my modules...
Module: Pixels in closed surface
Description:
Given an set of input surfaces, all assumed to be closed surfaces, and an input image (used to define dimension, resolution, location, etc.), creates a similar output image in which a pixel is set to the surface number if the centre of the pixel is inside that surface.
Example : The image shows, in transparent, the closed surface, an octogon, and a slice of the resulting image, where the white pixels are the ones flagged as being inside the surface.
NOTES :
- Patch indices start at 1.
- The HxSurface data structure is comprised of patches. This module considers each patch as a distinct closed surface.
- During the computation, this module uses the Pixels_Of_Triangles compute module.
- Non-zero pixel centres are in a closed surface, strictly. They'll be zero if the centre lies outside of or on the surface
- If you choose to use this module with non-closed surface, nearly all pixels in the image will be identified as interior. The process fills the interior pixels once the border ones (those on or around the surface) are identified, assuming this border separates the remaining pixels into two distinct connected components.
- If two surfaces overlap, the pixel value in the overlapping region will be that of the patch with the highest index.
- The algorithm uses a ray-tracing and counts the number of traversals of the surface to determine inside and outside. With a continuous surface it's fine, but with a triangulated mesh, if the ray passes through an edge or vertex it is difficult to be sure for how many traversals that counts. The chosen option is to apply a jitter (a small random movement) to one of the vertices before the ray tracing. If this is done, a warning message will be displayed.
Connections:
Image
[required]
Input image, of type HxUniformScalarField3, used only to define the output (dimensions, size, location).
Triangles
[required]
Input surfaces, of type HxSurface. One patch in the surface represents a closed surface. They are all processed independently.
Ports:
Patch

Allows to choose whether only one patch, i.e. closed surface, is taken, or all of them.
Patch_number

If one patch is selected previously, this port selects the patch number.
Just_Do_It

Pressing this button starts the computation.
Commands:
Additional options can be accessed when typing in the console Pixels_In_Closed_Surface COMMAND_NAME.
verbose
Displays timing information.
create
Runs the computation. Returns the name of the output, so it can be used in a script, such as set RESULT [Pixels_In_Closed_Surface create].