GithubHelp home page GithubHelp logo

scala-express's Introduction

scala-express

Scala and scalajs library for BIM IFC text file format based on STEP file described by an EXPRESS schema

Goals

  1. Having a type-safe library for reading and writing IFC text file, heavy usage of type classes with help of Shapeless and Refined to ensure quality of encoding/decoding

  2. Generate Scala classes to manipulate STEP file from an EXPRESS schema

Step of "codec"

Similar to encoding/decoding solution from circe (just replace Json by Step)

  1. Parsing string/file/stream to Step class instances
  2. Try to convert each Step class instances to the good IfcEntity classes (with Strict, StrictOrConvert or Flexible validation)
  3. Use all Ifc instances as you want
  4. Convert each Ifc instances to Step instances but ensures that respects rules from IFC EXPRESS schema
  5. Build STEP text file from Step class instances

Strict, StrictOrConvert or Flexible validation

Example :

TYPE IfcGloballyUniqueId = STRING (22) FIXED And char should be in this list : 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$

representationContexts : OPTIONAL SET [1:?] OF IfcRepresentationContext

directionRatios : LIST [2:3] OF IfcReal

With Strict :

  • IfcGloballyUniqueId must be exactly 22 chars from the list or it will fail
  • representationContexts must be undefined or a non-empty list, or it will fail
  • directionRatios must be a list of 2 or 3 IfcReal, or it will fail

With StrictOrConvert :

  • IfcGloballyUniqueId will be updated to be exactly 22 chars from the list if needed
  • representationContexts will be updated to undefined if an empty list was set
  • directionRatios will be completed with IfcReal.Default and exceeding items will be dropped

With Flexible :

  • IfcGloballyUniqueId can contain anything and a warning is emitted
  • representationContexts could have an empty list and just a warning is emitted
  • directionRatios could have any size

Output mode can be StrictOrConvert while input mode was Flexible, the file will be normalized after that (if possible)

scala-express's People

Contributors

math85360 avatar

Watchers

James Cloos 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.