Renamed to ianmackenzie/elm-iso-10303. It is published under that name, and new versions come out there.
Versions published as ianmackenzie/elm-step-file still install under that name. 1 version of 2 come from the new location (see their notes).
Rerouted (renamed, needs approval). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/ianmackenzie/elm-iso-10303.
What we checked: The repo moved to github.com/ianmackenzie/elm-iso-10303 and tag 1.0.0 is there; its commit 212926a867bf is from 2018-11-13 21:23 UTC, after the version was published (2018-11-13 21:11 UTC); elm.json differs from package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one and nothing else confirms its contents.
We could not verify this copy against what was published, so the Lamdera compiler asks before using it (y/n). Without a terminal, as in CI, it stops with an error unless approved:
lamdera make --auto-approve-package-rerouting approves rerouted versions for that run,LAMDERA_AUTO_APPROVE_PACKAGE_REROUTING=1 does the same for every run in that environment,LAMDERA_CACHE=off skips the Lamdera package server altogether: packages come from package.elm-lang.org and GitHub only, as with elm, and a rerouted version then fails to download.Details · package.elm-lang.org's zip: https://github.com/ianmackenzie/elm-step-file/zipball/1.0.0/
This module allows you to encode data in ISO 10303-21 (STEP file) format.
The module name was chosen to avoid naming conflicts (and to emphasize that this is a low-level package), but in most cases I recommend importing it as
import Iso10303 as StepAll examples below assume the module has been imported this way.
A Header represents the data stored in the header section of a STEP file:
fileDescription should be an informal description of the contents of the
file.fileName may be the file name of the actual file, or it may be an abstract
name for the contents of the file used when cross-referencing between files.timeStamp should be an
ISO 8601-formatted date and time.author should include the name and address of the person who created the
file.organization should be the organization that the author is associated
with.preprocessorVersion or originatingSystem should identify what CAD
program was used to generate the file. This does not seem to be used
terribly consistently!authorization should include the name and address of whoever authorized
sending the file.schemaIdentifiers identifies the EXPRESS schema used by entities in the
file. This will usually be a list containing a single string, which may be
either a simple string like "IFC2X3" or an 'object identifier' such as
"AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }" (more commonly known as
AP214).An Entity represents a single entity stored in the data section of a STEP
file. An entity may be a point, a curve, a part, an assembly, or even an entire
building. Every entity has a type and a list of attributes (which can themselves
be references to other entities).
Construct a single entity with the given type and attributes. The type name
will be capitalized if necessary. An IfcDirection
representing the positive Y direction in 3D could be created using
direction =
Step.entity "IFCDIRECTION"
[ Step.list Step.float [ 0, 1, 0 ]
]which might get encoded as #1=IFCDIRECTION((0.,1.,0.));.
If a given entity is only referred to by a single other entity, you can create it directly inside the definition of the parent entity. For example, to create entity #121 from this AP214 example, you could use
Step.entity "AXIS2_PLACEMENT_3D"
[ Step.string ""
, Step.referenceTo <|
Step.entity "CARTESIAN_POINT"
[ Step.list Step.float [ 20, 7.5, 0 ]
]
, Step.referenceTo <|
Step.entity "DIRECTION"
[ Step.string ""
, Step.list Step.float [ 1, 0, 0 ]
]
, Step.referenceTo <|
Step.entity "DIRECTION"
[ Step.string ""
, Step.list Step.float [ 0, 0, -1 ]
]
]When actually encoded to a STEP file, this will get converted into four separate entities, with the top-level entity referring to the other three by their automatically-generated IDs, something like:
#1=AXIS2_PLACEMENT_3D('',#2,#3,#4);
#2=CARTESIAN_POINT('',(20.,7.5,0.));
#3=DIRECTION('',(1.,0.,0.));
#4=DIRECTION('',(0.,0.,-1.));An Attribute represents a single attribute of an Entity, such as an X
coordinate value, a GUID string, or a reference to another entity.
The special 'default value' attribute (* in the resulting STEP file).
The special 'null value' attribute ($ in the resulting STEP file).
Construct an integer-valued attribute.
Construct a real-valued attribute.
Construct a string-valued attribute. Unicode characters will be properly escaped according to the (weird, custom) method specified in the STEP standard; for example,
Step.string "see § 4.1"will end up being encoded as
'see \X\A7 4.1'Construct a reference to another STEP entity (will end up being encoded
using an integer ID in the resulting STEP file, e.g. #123).
Construct an attribute that refers to an enumeration value defined in an
EXPRESS schema. Enumeration values are always encoded as all-caps with leading
and trailing periods, like .STEEL..
This function will capitalize and add periods if necessary, so both Step.enum
"steel" and Step.enum ".STEEL." will be encoded as .STEEL..
Construct a binary-valued attribute. The provided string is assumed to already be hex encoded as required by the STEP standard.
Construct an attribute which is itself a list of other attributes. You provide a list of values and a function to convert each of those values to an attribute (which will usually be one of the attribute construction functions in this module!). For example, to construct an attribute which is a list of floats:
Step.list Step.float [ 0, 1, 0 ]To construct a list of references to various entities:
Step.list Step.referenceTo
[ firstEntity
, secondEntity
, thirdEntity
]In the odd case where you already have a List Attribute, you can use Elm's
built-in identity function as the first argument:
Step.list identity
[ firstAttribute
, secondAttribute
, thirdAttribute
]Typed attributes are sometimes needed when dealing with SELECT types.
Construct a type-tagged integer-valued attribute.
Construct a type-tagged float-valued attribute.
Construct a type-tagged string-valued attribute.
Construct a type-tagged enumeration attribute.
Construct a type-tagged binary-valued attribute.
Construct a type-tagged list attribute.
Build a string representing a complete STEP file from a header and a list of entities. Entities will be assigned integer IDs automatically, and nested entities (entities that reference other entities) will be 'flattened' into separate entities referring to each other by their automatically-generated IDs.
Note that it is not actually necessary to list all entities explicitly, only top-level ones; any entities that are referenced by entities in the given list will also get included in the output.