from models.mesh_geometry_coordinate_model import (
    MeshGeometryCoordinateModel,
)


class GetPartPrimitiveCoordinatesUseCase(object):
    """Get positions of parts in assembly

    Args:
        object : cad-model
    """

    def call(self, freeCadMetaModels):
        meshCoordinates: list[MeshGeometryCoordinateModel] = []
        for model in freeCadMetaModels:
            vertexesDetail = model.vertex
            labelDetail = model.label
            for coords in vertexesDetail:
                detailVertex = MeshGeometryCoordinateModel(
                    coords.X,
                    coords.Y,
                    coords.Z,
                    labelDetail,
                )
                meshCoordinates.append(detailVertex)

        return meshCoordinates
