Code Monkey home page Code Monkey logo

bim-whale's Introduction

bim-whale's People

Contributors

andrewisen avatar dependabot[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

bim-whale's Issues

Roadmap

Things todo:

  • Improve parser (more specific parse-step-instance-attributes.ts)
  • Add support for IfcProductType
  • Add dist (JS Bundle File)
  • Add web example (using the dist)
  • Implement Web Workers
  • Add more samples
  • Update Docs/Wiki
  • Fix spelling/language
  • etc. etc

Will there be added features?

The parser is very simple... it doesn't do much. Will there be added features?

In short, no. The goal of this repo is to provide learning resources.
I do not intend to build "the best parser in the world".... not yet :)

JSON parse error

See #3 for more information!

$,$,(#194,#212) is parsed into [$,"$",["#194","#212"]], which is wrong.

Parse properties correctly

Current output:

{
  TypeMark: "IFCLABEL('20')",
  Keynote: "IFCLABEL('--KEYNOTE--')",
  StoreyName: "IFCTEXT('Level: Level 1')",
  TypeDescription: "IFCTEXT('--DESCRIPTION--')",
  StatusConstruction: "IFCLABEL('New Construction')",
  NetArea: "IFCAREAMEASURE(3.18957899999998)",
  Height: "IFCLENGTHMEASURE(2134.)",
  Width: "IFCLENGTHMEASURE(915.)",
  SillHeight: "IFCLENGTHMEASURE(0.)",
  Hyperlink: "IFCTEXT('--URL--')"
}

Remove IFCTEXT, IFCLABEL, etc.

Improve attribute parser method

The method _parseStepInstanceAttributes is very slow and ugly.

            .replace(/\\/g, "") // backward slashes
            .replace(/\//g, "\\/") // forward slashes
            .replace(/\"/g, '\\"') // quotation marks
            .replace(/[^,]\'\'[^\)]/g, "") // Apostrophes
            .replace(/(\(|\,)(\..+\.)(\)|\,?)/g, "$1'$2'$3") // ".T.", ".F.", ".UNDEFINED.", etc.
            .replace(
                /([A-Z]+\()'?([0-9a-åA-Ö-_\/({}),.%&@$:;+=?*"#<> ]*)'?\)/g,
                "'$1$2)'"
            ) // 1. Functions
            .replace(/(,\$)/g, ",'$$'") // 2. Indefinite attribute A
            .replace(/(\$,)/g, "'$$',") // 2. Indefinite attribute B
            .replace(/(^|,)\((#\d+.*?)\)/g, "$1[$2]") // 3. Nested attributes:
            .replace(/([,\[])(#\d+)+/g, "$1'$2'") // 4. References to other entities
            .replace(/,(\d+[.]\d*)/g, ",'$1'") // / 5. Integers
            .replace(/'/g, '"') + // Convert apostrophes to quotes

This needs to be replaced (!).

I will go back to the drawing board and think of a better solution.

Update IFC naming convention

The term entity instance is a bit confusing.

What is the difference between "entity", "instance" and "entity instance"?

For example, the method generateStepInstance( ) doesn't make that much sense.
Things become more chaotic when we introduce instanceId and entityName.

Try to update the IFC naming convention to make the code more readable.

Difficult properties to parse

Some IfcPropertySingleValue that are difficult to parse

'Type',$,IFCLABEL('Table-Night Stand: 24" x 24" x 30"'),$
'URL',$,IFCLABEL('http://www.website.com/anchor#!/800X800-1'),$
'SystemID',$,IFCLABEL('Piping System: KB03R'),$
'TypeDescription',$,IFCTEXT('Circular, smooth,R=D'),$
'AboveGround',$,IFCLOGICAL(.U.),$
'StoreyName',$,IFCTEXT('Level: 02 - Floor'),$
'Diameter',$,IFCPOSITIVELENGTHMEASURE(315.),$
'TypeDescription',$,IFCTEXT('K30, R\X2\00F6\X0\rsk\X2\00E5\X0\l mineralull ytbekl armerad al-folie difft\X2\00E4\X0\t'),$
'Render Appearance Properties',$,IFCTEXT('{2, 15},{39, RPC-16-FXGQ-QK7X-PJ74-6000-ST1L-LVER-AU},{1, 0},{1, 0},{2, 36},{1, 8},{5, Color},{1, 0},{1, 0},{3, 0.8},{3, 0.8},{3, 0.8},{1, 8},{7, BBoxMin},{1, 0},{1, 0},{1, 0},{1, 0},{1, 0},{1, 8},{7, BBoxMax},{1, 0},{1, 0},{1, 0},{1, 0},{1, 0},{2, 11},{9, RPCTypeId},{1, 0},{1, 0},{39, RPC-16-FXGQ-QK7X-PJ74-6000-ST1L-LVER-AU},{1, 6},{14, RPCPlantHeight},{1, 0},{1, 0},{7, 18.0446},{2, 11},{7, keyword},{1, 0},{1, 0},{140, :Geometry:RPC:Golden-chain :Laburnum:Laburnums are very small trees native to southern Europe.  The common cultivar in Canada is ''Watereri''.},{2, 11},{8, category},{1, 0},{1, 0},{16, :Trees [General]},{2, 11},{12, LocalizedUID},{1, 0},{1, 0},{13, Golden-chain },{2, 14},{6, Height},{1, 0},{1, 0},{7, 18.0446},{1, 2},{16, Cast Reflections},{1, 0},{1, 0},{1, 0},{1, 2},{12, Cast Shadows},{1, 0},{1, 0},{1, 1},{1, 2},{9, Lock View},{1, 0},{1, 0},{1, 0},{1, 4},{5, ViewC},{1, 0},{1, 0},{1, 0},{2, 11},{11, RPCFilePath},{1, 0},{1, 0},{99, C:\\RevitRender\\Version2015940\\2017\\assetlibrary_base.fbm\\RPCs\\ArchVision_Stills_T5_Golden_Chain.rpc},{2, 11},{20, AdvancedUIDefinition},{1, 0},{1, 0},{0, },{2, 11},{10, AssetLibID},{1, 0},{1, 0},{36, 4D3F6E72-3F99-4203-98E9-AF80B3C7A7A4},{2, 11},{10, BaseSchema},{1, 0},{1, 0},{9, RPCSchema},{2, 11},{12, ExchangeGUID},{1, 0},{1, 0},{0, },{1, 2},{6, Hidden},{1, 0},{1, 0},{1, 0},{1, 4},{11, RPCCategory},{1, 0},{1, 0},{1, 0},{2, 11},{8, RPCImage},{1, 0},{1, 0},{0, },{1, 4},{13, SchemaVersion},{1, 0},{1, 0},{1, 5},{2, 11},{12, UIDefinition},{1, 0},{1, 0},{0, },{2, 11},{6, UIName},{1, 0},{1, 0},{39, RPC-16-FXGQ-QK7X-PJ74-6000-ST1L-LVER-AU},{2, 11},{11, VersionGUID},{1, 0},{1, 0},{9, RPCSchema},{2, 11},{9, assettype},{1, 0},{1, 0},{11, RPCGeometry},{2, 11},{11, description},{1, 0},{1, 0},{0, },{2, 11},{9, localname},{1, 0},{1, 0},{3, RPC},{2, 11},{9, localtype},{1, 0},{1, 0},{3, RPC},{1, 4},{8, revision},{1, 0},{1, 0},{1, 1},{2, 11},{9, thumbnail},{1, 0},{1, 0},{0, },{1, 4},{7, version},{1, 0},{1, 0},{1, 1},{1, 2},{20, RPC_Cast Reflections},{1, 0},{1, 0},{1, 1},{1, 2},{16, RPC_Cast Shadows},{1, 0},{1, 0},{1, 1},{1, 2},{13, RPC_Lock View},{1, 0},{1, 0},{1, 0},{1, 4},{9, RPC_ViewC},{1, 0},{1, 0},{1, 0},{21, assetlibrary_base.fbx},{1, 5},'),$
 '2moeq0lkL9rx1tiYe2hZKW',#42,'Pipe Insulation:K30:11937246',$,'Pipe Insulation:K30',#1365555,#1367655,'11937246',.INSULATION.

Remove Deno

Deno is an unnecessary dependancy. Replace with a regular JS bundler.

Add test

Deno has built in testing.
Add a simple test to make development easier.

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.