Cadmesh - A CAD file interface for GEANT4

  •        0

UPDATEFebruary 18, 2010: Added support for COLLADA files (exportable from Google Sketchup) - requires QtXml and OpenGl. Enabled with ./configure --enable-collada User-code GNUMakefiles only require "include cadmesh.gmk" for compilation with settings made during configure persevered. Building with cmake is coming... October 17, 2011: Version v0.6.1 available in the downloads section (replacing v0.6) fixing compile errors if all includes not in the same direction when compiling shared library (old bug reintroduced with previous update). October 10, 2011: Version v0.6 available in the downloads section now includes the new autoconf configure scripts with new installation instructions below. August 13, 2011: Development branch update: now contains an autoconf configure script to aid building, new constructors with various optional arguments have been included, and cadmesh now compiles to a shared object library for linking against. Browse the repo here May 31, 2011: The requirement for all GEANT4 headers to be installed in one directory has been removed with a modification to the Makefile (thanks Andrea Ferrero). May 25, 2011: Added the offset argument to CADMesh::LoadMesh allowing for arbitrary (x, y, z) offsets to be applied to all coordinates. Useful if the CAD model has absolute coordinates. Added reverse argument to CADMesh::LoadMesh allowing for the vertex read direction to be reverses; this can solve inside/outside navigation errors. IntroductionImporting predefined CAD models into GEANT4 is not always possible or requires intermediate file format conversion to Geometry Description Markup Language (GDML) using commercial or third party software. CADMesh is a direct CAD model import interface for GEANT4 leveraging VCGLIB. Currently it supports the import of triangular facet surface meshes defined in formats such as STL and PLY. A G4TessellatedSolid is returned and can be included in a standard user detector constructor. Additional functionality is included for the fast navigation of tessellated solids by automatically creating equivalent tetrahedral meshes thereby making smart voxelisation available for the solid. Citing CADMeshCADMesh is described in a pre-print publication, available here. If you would like the cite the article, you may wish use the following bibtex entry: @article{poole2011acad, author = {Poole, C. M. and Cornelius, I. and Trapp, J. V. and Langton, C. M.}, title = {{A CAD Interface for GEANT4}}, journal={Arxiv preprint arXiv:1105.0963},, year = 2011, month = April,}Example UsageThe following shows basic usage for cadmesh in a UserDetectorConstruction, a complete example can be found here // User Detector Constructor#include "CADMesh.hh"...G4ThreeVector offset;G4VSolid * cad_solid;G4LogicalVolume * cad_logical;G4VPhysicalVolume * cad_physical;...offset = G4ThreeVector(-30*cm, 0, 0);CADMesh * mesh = new CADMesh("../../models/cone.ply", "PLY", mm, offset, false);cad_solid = mesh->TessellatedMesh();cad_logical = new G4LogicalVolume(cad_solid, water, "cad_logical", 0, 0, 0);cad_physical = new G4PVPlacement(0, G4ThreeVector(), cad_logical, "cad_physical", world_logical, false, 0);...# GNUMakefilename := exampleG4TARGET := $(name)G4EXLIB := trueinclude cadmesh.gmk.PHONY: all all: lib bin include $(G4INSTALL)/config/binmake.gmkDependenciesA working installation of the folowing libraries or packages is required: GEANT4 VCGLIB TETGEN QT & OpenGL (for COLLADA support) Installation (v0.6 and above)For installation of v0.5 and below see the wikipage OldInstallation. Everyone else, download the latest release of CADMesh from the Downloads section, and extract the archive, or checkout the development branch from the repository. Additionally, download VCGLIB (you can find more information about acquiring VCGLIB here) and download tetgen from here (on ubuntu you can sudo apt-get install libtet1.4.2-dev). # Checkout VCGLIBsvn co https://vcg.svn.sourceforge.net/svnroot/vcg/trunk/vcglib vcglib# CADMesh latest dev branchhg clone https://code.google.com/p/cadmesh/ # OR with source from downloads sectiontar xvjf cadmesh-VERSION.tar.bz2cd cadmesh/# General autoconf options for ./configure --help help topics --prefix=dir change install location from /usr/local/bin --enable-debug enable extra output # For CAD only ./configure --disable-tetgen --with-vcglib=dir# FOR TET only./configure --disable-vcglib# OR if tetgen not installed./configure --disable-vcglib --with-tetgen=dir# FOR CAD and TET./configure --with-vcglib=dir# OR if tetgen not installed./configure --with-vcglib=dir --with-tetgen=dir# FOR COLLADA SUPPORT./configure --enable-vcglib --enable-collada --with-qt=dirmakesudo make install# Run example (Linux with g++)cd examples/basicmake$G4WORKDIR/bin/Linux-g++/cadmesh_exampleIdle> exitIf you encounter any problems send me an email or open an Issue on the tracker. Status/Road-mapCurrently there is public support for importing triangular facet meshes defined in PLY, STL or OFF file formats. Work is continuing

http://code.google.com/p/cadmesh

Tags
Implementation
License
Platform

   




Related Projects

raspBerry+


raspBerry+ is a web-based administration platform for Blackberry Enterprise Server for MS Exchange (BES). You can group-based activate/kill/delete/add and get status of users, their handhelds and services. With a little download-area and a comment-system

RASP


RASP's A Sneakernet Proxy; download using a thumbdrive.

RasmusDSP


RasmusDSP is an embeddable Audio/MIDI processor. It contains various filters and generators (including SoundFont 2.0 compatible synthesizer). Has a script interpreter which is used to describe instruments, route Audio/MIDI signal between processor units.

Rasea


An acronym for cRoss-plAtform accesS control for Enterprise Applications. Rasea aims to become a reference in access control as a service based on the RBAC model.

Rascal


Rascal, the Advanced Scientific CALculator, is a platform independent modular calculator. Based on modules for integer, doubles, strings, vectors and matrices it can be easily extended with existing C or C++ code.

Rars


RARS is the Robot Auto Racing Simulation, in which the drivers are robot programs. It is intended as a competition among programmers. It consists of a simulation of the physics of cars, a graphic display of the race, and a robot driver for each car.

RARPlayer


This small program allows you to play a video directly from a RAR file and do so in real-time. Both VLC and MPlayer are supported video players.

RAReXtract


RAReXtract is a Front-End for the UnRAR command line utility for Mac OS X 10.5 (Leopard). Its purpose is the rapid and convenient extraction of RAR archives with a double click.

RAR Expander


Rar Expander is a MacOSX program which extracts the files contained in single or multi-volume RAR archives. It uses the official unRAR library internally so it is fully compatible with archives produced by WinRAR.

rarcrack


This program uses a brute force algorithm to guess your encrypted compressed file\'s password. If you forget your encrypted file password, this program is the solution. This program can crack zip,7z and rar file passwords.

RArcInfo


RArcInfo is a package for R (http://www.r-project.org) to import data from binary Arc/Info V7.X coverages and E00 files . This will allow R users to used it as a primary GIS tool.

rar brute force shell script - rarbrute


This is rarbrute, a shell script to brute force encrypted rar files under unix and linux. A long wordlist and a paper about security in internet cafes is included.

Raquel Database System


The system will : 1. use RAQUEL (= Relational Algebra Query, Update and Executive Language) for programming, implementing Third Manifesto principles. 2. have a 'Lego-like' architecture of building blocks and plug-ins, for wider applicability.

RAPv4


RAPv4 is an engine for building web application with only a business description (in XML format). NEW 04/2006 : Stable 2006 release. Add new functions like mail, sms, web services, graph, map engine (GIS), Excel output, QBE... and also a beta release of

Rafkill


2d Scroller. Clone of Raptor: Call of the Shadows and Tyrian. Fun game written in c++ using allegro.

rapple


Lightweight XML based transformation tool written in C that builds upon expat, tidylib and XSLT to tranform authored web content (incl. Word processor generated HTML) into styled web content suitable for publication.

RapidSMS


RapidSMS is an open-source internet and communications platform

RapidSmith


RapidSmith is a research-based FPGA CAD tool framework written in Java for modern Xilinx FPGAs. Based on XDL, its objective is to serve as a rapid prototyping platform for research ideas and algorithms relating to low level FPGA CAD tools.

Rapidshare Mass Downloader


What this program does is bringing out human interaction while downloading files from rapidshare(without premium account). It downloads all the rapidshare links sequentially to the specified location.

rapido visual profiler


rapido is a visual profiler for linux-x86. It traces function call using the ptrace interface and displays the information collected in a nice visual flow chart. rapido does not require the re-compilation of the application.