@thi.ng/iges
TypeScript icon, indicating that this package has built-in type declarations

2.1.125 • Public • Published

@thi.ng/iges

npm version npm downloads Mastodon Follow

[!NOTE] This is one of 192 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.

🚀 Please help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️

About

IGES 5.3 serializer for (currently only) polygonal geometry, both open & closed.

Mainly intended for exporting geometry to be used in various CAD applications (e.g. Rhino, Houdini, Fusion 360)

houdini

Status

ALPHA - bleeding edge / work-in-progress

Search or submit any issues for this package

Related packages

  • @thi.ng/geom - Functional, polymorphic API for 2D geometry types & SVG generation

Installation

yarn add @thi.ng/iges

ESM import:

import * as iges from "@thi.ng/iges";

Browser ESM import:

<script type="module" src="https://cdn.skypack.dev/@thi.ng/iges"></script>

Skypack documentation

For Node.js REPL:

const iges = await import("@thi.ng/iges");

Package sizes (brotli'd, pre-treeshake): ESM: 2.40 KB

Dependencies

API

Generated API docs

import * as iges from "@thi.ng/iges";

const doc = iges.newDocument({
    maxCoord: 100,
    precision: 3,
    author: "toxi",
    authorOrg: "thi.ng",
});

doc.start = [
    "Example file for @thi.ng/iges",
    "Defines single open 2D polyline (type 106)"
];

iges.addPolyline(doc, [
    [0,0],
    [0, 100],
    [50, 150],
    [100, 100],
    [0, 100],
    [100, 0],
    [0, 0],
    [100, 100],
    [100, 0]
]);

console.log(iges.serialize(doc));

Resulting output (IGES is a text file format):

Example file for @thi.ng/iges                                           S      1
Defines single open 2D polyline (type 106)                              S      2
1H,,1H;,,,12H@thi.ng/iges,5H0.0.1,32,38,6,308,15,,1.000,2,2HMM,1,0.254, G      1
15H20180712.212228,0.001,100.000,4Htoxi,6Hthi.ng,11,0,                  G      2
15H20180712.212228;                                                     G      3
     106       1       0       0       0       0       0       000000000D      1
     106       0       0       3      11       0       0               0D      2
106,1,9,0.000,0.000,0.000,0.000,100.000,50.000,150.000,100.000,  0000001P      1
100.000,0.000,100.000,100.000,0.000,0.000,0.000,100.000,100.000, 0000001P      2
100.000,0.000;                                                   0000001P      3
S0000002G0000003D0000002P0000003                                        T      1

Authors

If this project contributes to an academic publication, please cite it as:

@misc{thing-iges,
  title = "@thi.ng/iges",
  author = "Karsten Schmidt",
  note = "https://thi.ng/iges",
  year = 2016
}

License

© 2016 - 2024 Karsten Schmidt // Apache License 2.0

Dependents (0)

Package Sidebar

Install

npm i @thi.ng/iges

Weekly Downloads

129

Version

2.1.125

License

Apache-2.0

Unpacked Size

44.6 kB

Total Files

8

Last publish

Collaborators

  • thi.ng