Exemple #1
0
    def _generate_cap_surface(self):
        """
        Generate vertices and triangles for the cylindrical cap of the parabolic primitive
        :return:
        """

        self._cap_vertices, self._cap_triangles = triangulate_cylinder_lid(
            self._raysect_object.radius,
            self.radial_divisions,
            cylindrical_divisions=self.cylindrical_divisions)
    def _generate_back_surface_mesh(self):

        if self._barrel_vertices is None or self._barrel_triangles is None:
            self._generate_barrel_surface_mesh()

        radius = 0.5 * self.raysect_object.diameter
        edge = self._barrel_vertices[0:self.cylindrical_divisions, 0:2]

        vertices, triangles = triangulate_cylinder_lid(radius,
                                                       self.radial_divisions,
                                                       edge_vertices=edge)

        self._back_vertices = vertices
        self._back_triangles = triangles
    def _generate_front_surface_mesh(self):

        if self._barrel_vertices is None or self._barrel_triangles is None:
            self._generate_barrel_surface_mesh()

        radius = self.raysect_object.radius
        edge = self._barrel_vertices[0:self.cylindrical_divisions, 0:2]

        vertices, triangles = triangulate_cylinder_lid(radius,
                                                       self.radial_divisions,
                                                       edge_vertices=edge)

        vertices[:, 2] = self.raysect_object.height

        self._front_vertices = vertices
        self._front_triangles = triangles