Skip to content

integral over embedded, straight line #683

Discussion options

You must be logged in to vote

If the topology is 2d you can create a levelset that vanishes at the line through x0 and x1, trim the topology and take the trim boundary. Example for Nutils v6 and up:

import numpy
from nutils import function
from nutils.topology import Topology

def make_line_2d(topo: Topology,
                 x: function.Array,
                 x0: numpy.ndarray,
                 x1: numpy.ndarray,
                 end_at_points=True,
                 maxrefine: int = 0) -> Topology:
    '''Create a line topology through the given points.

    By default the line topology ends in the given points. Setting
    ``end_at_points`` to false lets the line extend to the bounary of the
    topology.

    Para…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Siamakpk
Comment options

@joostvanzwieten
Comment options

Answer selected by joostvanzwieten
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants