Coder Social home page Coder Social logo

datloader's Introduction

DATLoader using three.js

NASTRAN Software

Since the 1960โ€™s NASTRAN (NASA Structural ANalysis) has been used to solve structural/thermal/aerodynamic/dynamics/etc. problems. The file formats were originally developed by MSC for a product now called MSC Nastran. There have been many spinoff version of NASTRAN that have been created based on the 2001 source code release of MSC Nastran in 2002 after settlement with the FTC (Federal Trade Commisson). There is now NX Nastran and NEi Nastran, which are developed independently.

This text above is from pyNastran.

three.js

three.js is a JavaScript library with the aim to create a lightweight 3D library with a very low level of complexity. You only need a browser with WebGL compatibility (almost all)!

Three.js Examples

BDF and DAT files

BDF and DAT are the geometries files for Nastran and FEMAP Software, both files are almost equal and the geometric data in these files are reported in MSC Nastran Quick Reference Guide

Example: https://datloader-heltonitba.c9.io/

Version

three.js 71

Suported Elements:

  • GRID
  • CTRIA3, CTRIA6,CRTIAR and CTRIAX
  • CQUAD, CQUAD4, CQUAD6 and CQUAD8
  • CTRETA, CPENTA and CHEXA
  • CBAR

Suported Properties:

  • PBAR
  • PSHELL (Just read, doesn't draw)

Suported Base:

  • Base Rectangular (Very important!)

Usage

Include the file:

<script src="js/DATLoader.js"></script>

The load method return a THREE.Geometry.

var loader = new THREE.DATLoader();    
var material = new THREE.MeshBasicMaterial({vertexColors: THREE.FaceColors,side: THREE.DoubleSide});

loader.load('./file.dat', function(geometry,DATData) {
        //Warning: DATData can be heavy to display
        //console.log(DATData);
        
        mesh = new THREE.Mesh(geometry, material);        
        scene.add(mesh);
        
        //Update camera and controls
        camera.position.copy(geometry.boundingBox.min);
        controls.target.copy(geometry.boundingSphere.center);
  
    });

By default, each Element will be printed with random color.

DATData:

DATData is a return of load function who carry a important data from DAT/BDF file loaded, first, the attributes:

  • Nodes: GRID/Vertice/Point
  • Elements: All supported Elements
  • Properties: All supported Properties
  • faceElement: Relation between faceIndex and Element ID

and DATData methods:

  • getElementByFaceIndex(faceIndex)
  • getElemet(elementID) //is the same of DATData.elements[elementID]
  • getFacesOfElementID(elementID) // return all faceIndex of respective Element ID

datloader's People

Contributors

heltonitba 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.