Giter VIP home page Giter VIP logo

cadmesh's Introduction

Cadmesh

Topology, geometry and mesh extraction from CAD files.

Installation

conda env create -f environment.yml

EntityMapper

The entity mapper is used to translate between Open Cascade Topo_DS entities and the indices which will be written into the file. The entity mapper uses the Open Cascade hash value as a unique identifier to each Topo_DS.

A simple example of usage

entity_mapper = EntityMapper(shapes)
for shape in shapes:
    top_exp = TopologyExplorer(shape)
    faces = top_exp.faces()
    for face in faces:
        face_index_for_file = entity_mapper.face_index(face)

In the special case of edges, two different indices can be enquired.

The index of an edge ignoring the Orientation flag can be found using

edge_index = entity_mapper.edge_index(edge)

The index of an edge taking account of its orientation can be found like this

halfedge_index = entity_mapper.halfedge_index(edge)

TopologyDictBuilder

This class can be used to create the python dictionary which we can serialize to generate the topology file. It uses the entity mapper to define the indices of each Open Cascade entity. An example of usage

entity_mapper = EntityMapper(shapes)
builder = TopologyDictBuilder(shapes)
body_dict = builder.build_dict_for_bodies(shape)

topology_utils.orientation_to_sense()

Utility to convert Open Cascade TopAbs_Orientation enum to a kind of "sense" flag. TopAbs_FORWARD -> True TopAbs_REVERSED -> False All other values trigger an assert.

utest_topology_dict_builder.py

This contains tests for the functionality in the TopologyDictBuilder

New test data

image

The AVoid.stp test example contains an internal void inside the block image

cadmesh's People

Contributors

joelambourne avatar skoch9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cadmesh's Issues

Gmesh can not mesh surface

Hello, in the old folder, running gmsh.model.mesh.generate(2) gets stuck in Meshing 2D, I am wondering if it is because of the version of gmesh that I use. would you please provide your gmesh version?

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.