How to use the pygmsh.built_in.line_loop.LineLoop function in pygmsh

To help you get started, we’ve selected a few pygmsh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / pygmsh / pygmsh / built_in / surface.py View on Github external
def __init__(self, line_loop, api_level=2):
        assert isinstance(line_loop, LineLoop)

        self.line_loop = line_loop

        self.id = f"rs{Surface._ID}"
        Surface._ID += 1

        # `Ruled Surface` was deprecated in Gmsh 3 in favor of `Surface`.
        name = "Surface" if api_level > 2 else "Ruled Surface"

        self.code = "\n".join(
            [f"{self.id} = news;", f"{name}({self.id}) = {{{self.line_loop.id}}};"]
        )
        self.num_edges = len(line_loop)
        return
github nschloe / pygmsh / pygmsh / built_in / line_loop.py View on Github external
def __init__(self, lines):
        self.lines = lines

        self.id = f"ll{LineLoop._ID}"
        LineLoop._ID += 1

        self.code = "\n".join(
            [
                f"{self.id} = newll;",
                "Line Loop({}) = {{{}}};".format(
                    self.id, ", ".join([l.id for l in lines])
                ),
            ]
        )
        return
github nschloe / pygmsh / pygmsh / built_in / geometry.py View on Github external
def add_line_loop(self, *args, **kwargs):
        p = LineLoop(*args, **kwargs)
        self._GMSH_CODE.append(p.code)
        return p
github nschloe / pygmsh / pygmsh / built_in / plane_surface.py View on Github external
def __init__(self, line_loop, holes=None):
        super().__init__()

        assert isinstance(line_loop, LineLoop)
        self.line_loop = line_loop

        if holes is None:
            holes = []

        # The input holes are either line loops or entities that contain line
        # loops (like polygons).
        self.holes = [h if isinstance(h, LineLoop) else h.line_loop for h in holes]

        line_loops = [self.line_loop] + self.holes
        self.code = "\n".join(
            [
                f"{self.id} = news;",
                "Plane Surface({}) = {{{}}};".format(
                    self.id, ",".join([ll.id for ll in line_loops])
                ),
            ]
        )
        self.num_edges = len(self.line_loop) + sum(len(h) for h in self.holes)
        return
github nschloe / pygmsh / pygmsh / built_in / plane_surface.py View on Github external
def __init__(self, line_loop, holes=None):
        super().__init__()

        assert isinstance(line_loop, LineLoop)
        self.line_loop = line_loop

        if holes is None:
            holes = []

        # The input holes are either line loops or entities that contain line
        # loops (like polygons).
        self.holes = [h if isinstance(h, LineLoop) else h.line_loop for h in holes]

        line_loops = [self.line_loop] + self.holes
        self.code = "\n".join(
            [
                f"{self.id} = news;",
                "Plane Surface({}) = {{{}}};".format(
                    self.id, ",".join([ll.id for ll in line_loops])
                ),