pub(crate) struct MeshBuilder {
    location: String,
}
Expand description

General Information

Needs .obj. Needed elements to create mesh (1D, 2D or 3D). Builds real structure parsing .obj and distinguishing internal and boundary vertices.

Fields

  • location - Path to .obj.

Fields§

§location: String

Implementations§

Creates initial instance. Not to be used on it’s own. Use Mesh::build.

Checks wether a line starting with ’v ’ in an obj has the three vertices needed. Auxiliar function used inside build methods. Part of the checkup made to a given input file.

Verifies the amount of face specifications per line is 3 and also that all of them have the correct syntax ‘a/b/c’. Auxiliar function used inside build methods. Part of the checkup made to a given input file.

General information

Returns hashmap with every diferent value per coordinate inside .obj. It’s useful to check if a given .obj is a 2d or 1d mesh.

Parameters
  • &self - Only the file in self is needed to make the verification.
General Information

Builds a one dimensional mesh. Only a line of well defined points is needed. The method will create another paralell line to generate a bar copying every important element. Colors for mesh are inserted into vertices array, therefore, every vertex has 6 entries: 3 for coordinates and 3 for color (RGB), Faces are not needed in .obj for this method

Parameters

self - Consumes builder.

General Information

Builds a two dimensional mesh. A different approach needs to be taken to distinguish boundary vertices from internal ones. Algorithm consists on checking if a given edge from mesh appears once or more. If it appears only once, then the vertex is at the boundary (since it’s only adjacent to a single traingle), otherwise, it’s internal. Colors for mesh are inserted into vertices array, therefore, every vertex has 6 entries: 3 for coordinates and 3 for color (RGB).

Parameters

self - Consumes builder.

General Information

Builds a three dimensional mesh. A different approach needs to be taken to distinguish boundary vertices from internal ones. Algorithm not yet implemented Colors for mesh are inserted into vertices array, therefore, every vertex has 6 entries: 3 for coordinates and 3 for color (RGB).

Parameters

self - Consumes builder.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.