forked from kovacsv/occt-import-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,042 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=utf-8"> | ||
<meta name="viewport" content="width=device-width, user-scalable=no"> | ||
|
||
<title>OcctImportJS Demo</title> | ||
<script type="text/javascript" src="../dist/occt-import-js.js"></script> | ||
|
||
<script type='text/javascript'> | ||
window.onload = function () { | ||
occtimportjs ().then (async function (occt) { | ||
let fileUrl = 'testfiles/simple-basic-cube/cube.stp'; | ||
let response = await fetch (fileUrl); | ||
let buffer = await response.arrayBuffer (); | ||
let fileBuffer = new Uint8Array (buffer); | ||
let result = occt.ReadStepFile (fileBuffer); | ||
console.log (result); | ||
}); | ||
}; | ||
</script> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
let fs = require ('fs'); | ||
const occtImportJS = require ('../build_wasm/Release/occt-import-js.js')(); | ||
const occtimportjs = require ('../dist/occt-import-js.js')(); | ||
|
||
console.log ('started'); | ||
occtImportJS.then ((occt) => { | ||
console.log ('loaded'); | ||
let fileContent = fs.readFileSync ('testfiles/simple-basic-cube/cube.stp'); | ||
occtimportjs.then ((occt) => { | ||
let fileUrl = 'testfiles/simple-basic-cube/cube.stp'; | ||
let fileContent = fs.readFileSync (fileUrl); | ||
let result = occt.ReadStepFile (fileContent); | ||
console.log (result); | ||
console.log (result.shapes); | ||
}); |