GithubHelp home page GithubHelp logo

mfernba / rgwb Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 4.0 20.5 MB

rGWB: A basic solid modeler for Polyhedral 2-Manifold solids. Split, explode and boolean operations supported.

License: MIT License

C 89.36% C++ 8.69% Objective-C++ 1.84% Objective-C 0.11%
manifold-solids solid-modeling boolean-operations geometric-modeling polyhedral-model polyhedral geometric-workbench gwb brep cad

rgwb's Introduction

rGWB

An implementation of Martti Mäntylä's Geometric WorkBench

Test case

This is a working implementation of Martti Mäntylä's Geometric WorkBenchk. The Geometric Workbench (also known as GWB) is a polyhedral boundary representation geometric modeler for 2-Manifold solids.

For a long time, the source code developed for the book could be found at Martti Mäntylä's personal web page (http://www.cs.hut.fi/~mam/), but this code is old and incomplete, and the code in book sometimes is buggy (I suppose it's objective was to be illustrative -and really, it is-, not correct).

This implementations allows:

  • Sweep solids by extrusion or along a path (csmsweep.h, csmshape2d.h, csmbasicshape2d.h)
  • Quadrics solids (csmquadrics.h)
  • Split algorithm (csmsplit.h)
  • Boolean Operations (csmsetop.h)
  • Explode solids with several shells (csmexplode.h)

Look at Screenshots to get some sense of what can be done.

Test case

Implementation notes

IMPORTANT: The project has been developed using xcode and some parts of the system are tied to other tools I developed in the past, so don't expect (for now) that it compiles for you. You will need to provide your own implementation for the csmdebug.c.inl module and for the csmviewer.c.h module (or comment both). Also, the visualization extensions must be provided by you (I use an own developed scene graph). This only affects a few modules and should be easy to make it compile (I tested that).

I have reimplemented the core of the modeler by using code exposed on the the book and taking (and extending) some parts from original Mäntylä source code (part of the euler operators to match the expected algorithm behaviour and the vertex neighborhood classification strategy -which I needed to complete-).

The last resort of the null edge joining algorithm is based on: Bhardwaj, A. & Malik, I. (1997). Java Applet for Constructive Solid Geometry. Technical report, Computer Science Department, Cornell University. I was pointed to this source by the paper: "Reflections on the implementation of boolean operations with polyhedral solids" by Herbert J. Koelman from SARC BV.

Mäntylä's algorithm need maximal faces, so there is a simplification strategy both in solid generation and after solid operations in order to eliminate unessential elements.

A perturbation strategy is applied if the algorithm doesn't produce an output (it can't join all null edges). This could produce an incorrect output in some cases, but it's a last resort. Also, it reduces the possibility to get a non-manifold solid.

"Boundary representation modeling techniques" from Ian Stroud was also an unvaluable source of information, providing guidance about how to orient the implementation.

rgwb's People

Contributors

mfernba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.