Skip to content

Circle as custom style for a sensor #752

Answered by Alexboiboi
BastelBaus asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @BastelBaus,

Thanks for your interest in Magpylib ;)

As you pointed out, there are only 3D models available in the public API as helper functions. In your code you are using the private API which is not meant to be used that way. There is in fact a rather complex machinery to make this work internally.
There is however a simple way to achieve what you want by defining a custom trace as a dictionary (see also the example in the docs here).

import magpylib as magpy
import numpy as np


class CoilSensor(magpy.Sensor):
    def __init__(
        self,
        r,
        mode="2D",
        position=(0, 0, 0),
        orientation=None,
        pixel=None,
        handedness="right",
        s…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by BastelBaus
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