Code Monkey home page Code Monkey logo

Comments (1)

ALEEF02 avatar ALEEF02 commented on July 18, 2024

I'm having similar issues trying to visualize a ground plane with a hole for a via, as shown below. This portion for drawing a plane with via holes is adapted from documentation of the MATLAB portion here

bounding = {
    'x': mesh.GetSimArea()[:, 0],
    'y': mesh.GetSimArea()[:, 1],
    'z': mesh.GetSimArea()[:, 2],
    }

p = np.zeros((2, 26))
p[:, 0] = [bounding['x'][0], bounding['y'][0]]
p[:, 1] = [0, bounding['y'][0]]
a = np.linspace(-np.pi, np.pi, 19)
p[:, 2:21] = [
    (VIA_GAP + VIA_OUTTER_DIAMETER/2) * np.sin(a),
    (VIA_GAP + VIA_OUTTER_DIAMETER/2) * np.cos(a)
    ]
p[:, 21] = [0, bounding['y'][0]]
p[:, 22] = [bounding['x'][-1], bounding['y'][0]]
p[:, 23] = [bounding['x'][-1], bounding['y'][-1]]
p[:, 24] = [bounding['x'][0], bounding['y'][-1]]
p[:, 25] = [bounding['x'][0], bounding['y'][0]]
gnd.AddPolygon(p, 'z', elevation=(OUTTER_SUBSTRATE_THICKNESS + MIDDLE_SUBSTRATE_THICKNESS), priority=10)

image
Where a polygon is expected on the entire top plane.

Modifying the code as such...

bounding = {
    'x': mesh.GetSimArea()[:, 0],
    'y': mesh.GetSimArea()[:, 1],
    'z': mesh.GetSimArea()[:, 2],
    }

p = np.zeros((2, 25))
p[:, 0] = [bounding['x'][0], bounding['y'][0]]
p[:, 1] = [0, bounding['y'][0]]
a = np.linspace(-np.pi, np.pi, 19)
p[:, 2:21] = [
    (VIA_GAP) * np.sin(a),
    (VIA_GAP) * np.cos(a)
    ]
p[:, 21] = [0, bounding['y'][0]]
p[:, 22] = [bounding['x'][-1], bounding['y'][0]]
p[:, 23] = [bounding['x'][-1], bounding['y'][-1]]
p[:, 24] = [bounding['x'][0], bounding['y'][-1]]
gnd.AddPolygon(p, 'z', elevation=(OUTTER_SUBSTRATE_THICKNESS + MIDDLE_SUBSTRATE_THICKNESS), priority=10)

creates this, where the polygon doesn't have the hole in the middle and is simply a triangle.
image
image

Plotting the object p in MatPlotLib verifies we have (at least geometrically) properly created the object.
image

from appcsxcad.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.