(
        self,
        outer_radius,
        inner_radius,
        length,
        R=np.eye(3),
        x0=np.array([0.0, 0.0, 0.0]),
        mesh_size=None,
    )
return vol
Hollow cylinder.
        Define a rectangle, extrude it by rotation.
Hollow cylinder.
        Define a rectangle, extrude it by rotation.
Hollow cylinder . Define a rectangle extrude it by rotation .
def _add_pipe_by_rectangle_rotation(
        self,
        outer_radius,
        inner_radius,
        length,
        R=np.eye(3),
        x0=np.array([0.0, 0.0, 0.0]),
        mesh_size=None,
    ):
        """Hollow cylinder.
        Define a rectangle, extrude it by rotation.
        """
        X = np.array(
            [
                [0.0, outer_radius, -0.5 * length],
                [0.0, outer_radius, +0.5 * length],
                [0.0, inner_radius, +0.5 * length],
                [0.0, inner_radius, -0.5 * length],
            ]
        )
        # Apply transformation.
        X = [np.dot(R, x) + x0 for x in X]
        # Create points set.
        p = [self.add_point(x, mesh_size=mesh_size) for x in X]

        # Define edges.
        e = [
            self.add_line(p[0], p[1]),
            self.add_line(p[1], p[2]),
            self.add_line(p[2], p[3]),
            self.add_line(p[3], p[0]),
        ]

        rot_axis = [0.0, 0.0, 1.0]
        rot_axis = np.dot(R, rot_axis)
        point_on_rot_axis = [0.0, 0.0, 0.0]
        point_on_rot_axis = np.dot(R, point_on_rot_axis) + x0

        # Extrude all edges three times by 2*Pi/3.
        previous = e
        angle = 2 * np.pi / 3
        all_surfaces = []
        # com = []
        for _ in range(3):
            for k, p in enumerate(previous):
                # ts1[] = Extrude {{0,0,1}, {0,0,0}, 2*Pi/3}{Line{tc1};};
                top, surf, _ = self.revolve(
                    p,
                    rotation_axis=rot_axis,
                    point_on_axis=point_on_rot_axis,
                    angle=angle,
                )
                # if k==0:
                #     com.append(surf)
                # else:
                #     all_names.appends(surf)
                all_surfaces.append(surf)
                previous[k] = top
        #
        # cs = CompoundSurface(com)
        # Now just add surface loop and volume.
        # all_surfaces = all_names + [cs]
        surface_loop = self.add_surface_loop(all_surfaces)
        vol = self.add_volume(surface_loop)
        return vol
def _add_pipe_by_rectangle_rotation ( self , outer_radius , inner_radius , length , R = np . eye ( 3 ) , x0 = np . array ( [ 0.0 , 0.0 , 0.0 ] ) , mesh_size = None , ) : X = np . array ( [ [ 0.0 , outer_radius , - 0.5 * length ] , [ 0.0 , outer_radius , + 0.5 * length ] , [ 0.0 , inner_radius , + 0.5 * length ] , [ 0.0 , inner_radius , - 0.5 * length ] , ] ) # Apply transformation. X = [ np . dot ( R , x ) + x0 for x in X ] # Create points set. p = [ self . add_point ( x , mesh_size = mesh_size ) for x in X ] # Define edges. e = [ self . add_line ( p [ 0 ] , p [ 1 ] ) , self . add_line ( p [ 1 ] , p [ 2 ] ) , self . add_line ( p [ 2 ] , p [ 3 ] ) , self . add_line ( p [ 3 ] , p [ 0 ] ) , ] rot_axis = [ 0.0 , 0.0 , 1.0 ] rot_axis = np . dot ( R , rot_axis ) point_on_rot_axis = [ 0.0 , 0.0 , 0.0 ] point_on_rot_axis = np . dot ( R , point_on_rot_axis ) + x0 # Extrude all edges three times by 2*Pi/3. previous = e angle = 2 * np . pi / 3 all_surfaces = [ ] # com = [] for _ in range ( 3 ) : for k , p in enumerate ( previous ) : # ts1[] = Extrude {{0,0,1}, {0,0,0}, 2*Pi/3}{Line{tc1};}; top , surf , _ = self . revolve ( p , rotation_axis = rot_axis , point_on_axis = point_on_rot_axis , angle = angle , ) # if k==0: #     com.append(surf) # else: #     all_names.appends(surf) all_surfaces . append ( surf ) previous [ k ] = top # # cs = CompoundSurface(com) # Now just add surface loop and volume. # all_surfaces = all_names + [cs] surface_loop = self . add_surface_loop ( all_surfaces ) vol = self . add_volume ( surface_loop ) return vol