Iray SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::IWelder Class Referenceabstract

Functor to weld a triangle mesh. More...

#include <iwelder.h>

Inheritance diagram for mi::neuraylib::IWelder:

Public Member Functions

virtual ITriangle_meshrun (const ITriangle_mesh *mesh, const IDictionary *options)=0
 Welds points of a single input mesh up to a given distance threshold, i.e., points of similar coordinates are merged into a single representation. More...
 
virtual IArrayrun (const IArray *meshes, const IArray *obj_to_world_trans, const IDictionary *options)=0
 Welds points of an array of input meshes up to a given distance threshold, i.e., points of similar coordinates are merged into a single representation. More...
 
- Public Member Functions inherited from mi::neuraylib::IFunctor_base
virtual IDictionaryget_default_options () const =0
 Returns the default options for this functor. More...
 
virtual bool options_valid (const IDictionary *options)=0
 Checks whether the options are valid for the functor. More...
 
virtual const IDictionaryget_options_type () const =0
 Returns the types of all options. More...
 
virtual const IDictionaryget_options_description () const =0
 Returns the descriptions of all options. More...
 
virtual const char * error_text () const =0
 Returns a descriptive string for the last error. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xc422a884, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0xee412b14, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xc422a884, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xee412b14, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

Functor to weld a triangle mesh.

This functor merges possibly multiple meshes and welds identical or almost identical points into one point.

The input meshes may be non-manifold and non-orientable, and they may contain boundary edges. The output mesh may contain all such features, even if the input meshes did not contain them, since the welding of points may connect things that were disconnected before.

All attribute vectors from the input meshes will be copied and acquired by the resulting mesh. The new attribute vectors will have zero values for places where the corresponding input meshes did not provide attribute values.

The algorithm is offered in two variants: variant one processes a single mesh while variant two processes an array of meshes.

As an option the distance threshold above which no points and no attributes should be merged can be controlled. The merging of geometrical points in space can be prevented by attribute discontinuities.

Note that, due to the fact that two or more points of the same face may collapse into one, the number of triangles may decrease. Degenerate faces are eliminated automatically.

Option key Value type Default value Description
"point_tolerance" mi::Float64 0 Tolerance default value used for geometry welding, i.e., the maximum allowed distance of points to be merged into a single point.
"point_representative" const char* "best_fit" This option defines how representative of a cluster should be computed. If set to "centroid", all points falling into the cluster are averaged. If set to "best_fit", the welder aims at minimizing the integrated geometric error and preserving the enclosed volume. The first variant is slightly faster, but should only be used for very small tolerance values. If the tolerance is set to zero, this option will be ignored.

Member Function Documentation

 run() [1/2]

virtual IArray * mi::neuraylib::IWelder::run ( const IArray meshes,
const IArray obj_to_world_trans,
const IDictionary options 
)
pure virtual

Welds points of an array of input meshes up to a given distance threshold, i.e., points of similar coordinates are merged into a single representation.

Returns an array of welded meshes.

Parameters
meshesThe array of input meshes. Boundaries, non-manifold, and non-orientable situations are allowed. The input mesh will not be modified.
obj_to_world_transThe array of object-to-world transformations of type mi::IFloat64_4_4, corresponding to the input meshes.
optionsAn option set to customize the algorithms behavior. A default options set can be obtained from mi::neuraylib::IFunctor_base::get_default_options() const.
Returns
An array of welded mesh containing all merged and welded input meshes. This array can contain more than one mesh, if not all the input meshes are pairwise compatible for merging, for example, because they have different flags or different types of attributes. These meshes live in world space.

 run() [2/2]

virtual ITriangle_mesh * mi::neuraylib::IWelder::run ( const ITriangle_mesh mesh,
const IDictionary options 
)
pure virtual

Welds points of a single input mesh up to a given distance threshold, i.e., points of similar coordinates are merged into a single representation.

Parameters
meshThe input mesh. Boundaries, non-manifold, and non-orientable situations are allowed. The input mesh will not be modified.
optionsAn option set to customize the algorithms behavior. A default options set can be obtained from mi::neuraylib::IFunctor_base::get_default_options() const.
Returns
The welded mesh containing all merged and welded input meshes.