Looking to create a ShapeGeometry that can be defined by a list of points representing the shape boundary or faces, along with a corresponding list of textures for each face. While the BoxBufferGeometry class provides a starting point, I am in need of guidance and examples on how to handle a variable number of points and calculate vertices, indices, normals, and UVs procedurally based on this list of points or vectors.
I have extended the buildplane section to accommodate two cubes, resulting in two nested cubes being displayed. However, I am unsure how to position or place the second set of shape vectors in relation to the first. Although I have tried using the merge mesh function, it causes the joined faces to display a line despite being on the same "plane". Additionally, custom angles cannot be achieved using existing geometries.
buildPlane( 'z', 'y', 'x', - 1, - 1, basedepth, baseheight, basewidth, depthSegments, heightSegments, 0 ); // px
buildPlane( 'z', 'y', 'x', 1, - 1, basedepth, baseheight, - basewidth, depthSegments, heightSegments, 1 ); // nx
buildPlane( 'x', 'z', 'y', 1, 1, basewidth, basedepth, baseheight, widthSegments, depthSegments, 2 ); // py
buildPlane( 'x', 'z', 'y', 1, - 1, basewidth, basedepth, - baseheight, widthSegments, depthSegments, 3 ); // ny
buildPlane( 'x', 'y', 'z', 1, - 1, basewidth, baseheight, basedepth, widthSegments, heightSegments, 4 ); // pz
buildPlane( 'x', 'y', 'z', - 1, - 1, basewidth, baseheight, - basedepth, widthSegments, heightSegments, 5 ); // nz
buildPlane( 'z', 'y', 'x', - 1, - 1, facedepth, faceheight, facewidth, depthSegments, heightSegments, 6 ); // px
buildPlane( 'z', 'y', 'x', 1, - 1, facedepth, faceheight, - facewidth, depthSegments, heightSegments, 7 ); // nx
buildPlane( 'x', 'z', 'y', 1, 1, facewidth, facedepth, faceheight, widthSegments, depthSegments, 8 ); // py
buildPlane( 'x', 'z', 'y', 1, - 1, facewidth, facedepth, - faceheight, widthSegments, depthSegments, 9 ); // ny
buildPlane( 'x', 'y', 'z', 1, - 1, facewidth, faceheight, facedepth, widthSegments, heightSegments, 10 ); // pz
buildPlane( 'x', 'y', 'z', - 1, - 1, facewidth, faceheight, - facedepth, widthSegments, heightSegments, 11 ); // nz
Currently seeking a solution to plot vectors or points in 3D space, define faces, and assign unique textures to each face as the shape is dynamically generated at runtime from saved data including location, size, and textures.
Illustration of the issue at hand: