Git Product home page Git Product logo

eggtol's Introduction

EGGTol: Error Generator for Geometric Tolerancing

A simple program to discretize surfaces from simple CAD models.

The splash screen

This is a full interface program that aims to discretize any kind of surface from a CAD model in IGES (Initial Graphics Exchange Specification) format. The main goal is to provide useful tools to create measurements errors and manufacturing errors, which will be used to analyse how these erros affects the model or the assembly in general.

It is currently under development, with this repo being used as the official repo.

The current interface

Instalation Instructions

The software is based on a CAD-Manipulation library: the PythonOCC wrapper of the OCCT (OpenCascade Technology). All the dependencies can be installed via Conda Package Management System. After installing the Anaconda Software, simply run:

conda create -n env -c numpy -c pythonocc -c oce pythonocc-core==0.17.3 python=3

This will create a Python Environment (just a folder with a Python Interpreter with the dependencies all set). This environment will contain, mainly:

  • A Python binding for the Qt Platform (A GUI cross-platform framework) : PyQt
  • A wrapper of the OCCT (OpenCascade Technology) : PythonOCC
  • A package for numerical and scientific computing : NumPy

After installing the Python Environment, rename the generated folder to "env" and copy it to the root folder of this project. The src\runMain.vbs is the script for launching the software.

Binary Release

After a few months of work, finally a binary release is avaliable at https://hideak.github.io. This binary file is a WinRAR Self-Extraction File, which is itself a .exe file containing an Installation Wizard. Just download the file and follow the Setup Instruction on your display.

License

This project is under the LGPL-3.0 (GNU Lesser General Public License), version 3 from 29 June 2007.

Authors

This is an Undergraduate Project that aims developing a software to discretize most CAD surfaces from CAD models.

Created mainly by Willian Hideak Arita da Silva under orientation of Rodrigo Junqueira Leão and Crhistian Raffaelo Baldo in CNPEM (Centro Nacional de Pesquisa em Energia e Materiais) - Campinas/SP, Brazil.

eggtol's People

Contributors

hideak avatar ro-oliveira95 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

eggtol's Issues

Add support to load multiple Manifold Solids

The following code was obtained from the Interface.ImportMenu module and is responsible for loading an .IGES file into the application. This part of the code uses a previously created Reader object to call an internal method named TransferList() to obtain all the loaded entities of the model, including all Manifold Solids, Faces, Surfaces, Edges, Vertices and other entities:

# Checking if the file were read successfully and creating a OpenCASCADE shape object:
shape = None
if status == IFSelect_RetDone:
    Reader.TransferList(Reader.GiveList('xst-model-all'))
    for i in range(1, Reader.NbShapes()+1):
        parent.shapeList.append(Reader.Shape(i))
    shape = Reader.Shape(1)

However, the shape variable only stores the first loaded shape: Reader.Shape(1) and thus, the following code:

# Displaying the loaded entity as an OpenCASCADE shape:
parent.canvas._display.DisplayShape(shape, update=True)

Just display the first entity, even if the loaded .IGES file contains multiple Manifold Solids.

The aim of this Issue is to implement a logic to load as many Manifold Solids as needed, so all of them can be used by the discretization methods.

Discretization Process: Units

Some CAD models in IGES file format uses different units to specify vertices, edges and faces. These units needs to be considered during the evaluation of the discrete surfaces.

Discretization Process: A minor displacement bug

When trying to auto-discretize a surface using the Discretization.DiscretizeModel.discretizeFace() method, if the default operation consists in using a points/cm value for the density argument, then the generated points will suffer from a minor displacement from some of the edges of the face.

Maybe this is mainly caused by the "Point in Polygon" algorithm that is used, but this is most likely to be a mathematical error while computing the edges.

Discretization Process: Allow for grid and points/mm discretization

The auto discretization process needs to be implemented in two different versions: one that considers only a grid of n x n points laid on a surface and another version that allows a consistent density of points. At this time, only the second version of the auto discretization process is implemented.

The implementation needs to affects how the Discretization.DiscretizeModel module works.

Menu Bar: Adding more selection options

The Menu Bar has some options for changing the default selection method. The selection method determines what kind of object will be selected after a mouse click. The possible selection methods are:

  • Manifold Solid Selection.
  • Face Selection.
  • Edge Selection.
  • Vertex Selection.

Each selection method needs to be implemented in the menu bar by calling the following methods:

parent.canvas._display.setSelectionModeNeutral()
parent.canvas._display.setSelectionModeFace()
parent.canvas._display.setSelectionModeEdge()
parent.canvas._display.setSelectionModeVertex()

Optimization: remove the use of the tmp/ directory

The tmp/ folder is a directory used for store information about non-planar discretized surfaces and loops. An implementation that doesn't require such directory will faster the discretization and will allow the software to run into folders that doesn't require administrative privileges on Windows.

Close Method: Problems after closing a file

In the Actions.ActionList module, the implemented closeActionProcedure() method needs to fix some unknown error, most common after changing the default visualization method of the CAD.

After closing some opened files, the actual visualization does not clean properly, usually, showing a "ghost" or faded image from the previous IGES file that was used.

More info:
If a user tries to open another IGES file, the new CAD model will be displayed over the preview one, which is, indeed, a notable bug.

Discretization Process: Implement individual discretization process

After implementing the auto-discretization process, new methods for individual discretizations will need to be implemented for handling other kinds of geometries.

Such geometries include:

  • Individual Plane Surfaces
  • Cylindrical and Conical Elements
  • The Sphere IGES Entity (Unsupported in the current state of the project)

Some of the implementations need only to be adapted since the auto-discretization process already has some functions for dealing with some of the individual surfaces.

Random Defects: Implementation

The random defects needs to be implemented.

The main goal here is to provide a useful sidebar/interface that allow users to apply random manufacturing erros in their cloud points data. This random errors will be generated by selecting a random direction and a random displacement that will be applied to all points in that specific direction. Further enhancements will be implemented, as selecting a normal or fixed direction.

Translational Defects: Implementation

The translational defects functionality for individual faces needs to be implemented.

The main issue in this is how to detect the normal direction given an IGES surface entity and a point that lies on that surface. Some methods using derivatives was presented in "The NURBS Book". These implementations may solve the present issue.

Rotational Defects: Crashes when using an invalid or blank angle value

The current implementation of the Rotational Defects Side Widget allows the user to input three values (x, y and z) for the desired rotation angle. These values are stored as fields of the rotationalDefectsMenu class, avaliable at the Interface.RotationalDefectsMenu module. These values need to be verified before the rotatePoints() method converts the self.xAngle, self.yAngle and self.zAngle to a floating point number, otherwise, an exception is generated and the software crashes.

Rotational Defects: Implementation

In the same way as the Issue #3, the rotational defects needs to be implemented.

The main goal here is to create a way for selecting individual edges or individual vetices to be used as references for the rotation axis. This can be implemented using the compute_bbox() function that is avaliable in the core_display_callbacks.py example of the pythonocc-core package.

Note that this function can be implemented directly in the source code of this project, without the need of importing content from the example module provided by the pythonocc-core package.

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.