Code Monkey home page Code Monkey logo

node-occ's People

Contributors

antonymarion avatar ceremcem avatar erossignon avatar victofel 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar

node-occ's Issues

Unable to install on Linux

Building is currently not possible on Linux either:

(nodeenv) ceremcem@cca-erik:node-occ$ ./build.sh 
  OCCT_TARFILE     =  occt-7.2.0-linux.tgz
  OCCT_TARFILE_URL =  https://github.com/OpenWebCAD/occt_builder/releases/download/7.2.0/occt-7.2.0-linux.tgz
--------------------------  OCCT TAR FILE occt-7.2.0-linux.tgz
Getting occt-7.2.0-linux.tgz
--2020-08-05 21:35:31--  https://github-production-release-asset-2e65be.s3.amazonaws.com/79847206/d514a23a-2e21-11e8-8682-7b3c669446b3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200805T183531Z&X-Amz-Expires=300&X-Amz-Signature=34036bfdcb13b1cebaf23706b0cd8c1b04a96f8fa5efc9e2d5519f76392b92f4&X-Amz-SignedHeaders=host&actor_id=0&repo_id=79847206&response-content-disposition=attachment%3B%20filename%3Docct-7.2.0-linux.tgz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.13.124
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.13.124|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 82073600 (78M) [application/octet-stream]
Saving to: ‘occt-7.2.0-linux.tgz.downloading’

occt-7.2.0-linux.tg 100%[===================>]  78.27M  1.16MB/s    in 1m 53s  

2020-08-05 21:37:30 (711 KB/s) - ‘occt-7.2.0-linux.tgz.downloading’ saved [82073600/82073600]

#define OCC_VERSION_COMPLETE     "7.2.1"
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   39 bits physical, 48 bits virtual
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              2
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           69
Model name:                      Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
Stepping:                        1
CPU MHz:                         1415.357
CPU max MHz:                     3000.0000
CPU min MHz:                     800.0000
BogoMIPS:                        4789.13
Virtualization:                  VT-x
L1d cache:                       64 KiB
L1i cache:                       64 KiB
L2 cache:                        512 KiB
L3 cache:                        4 MiB
NUMA node0 CPU(s):               0-3
Vulnerability Itlb multihit:     KVM: Mitigation: Split huge pages
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB fill
                                 ing
Vulnerability Srbds:             Mitigation; Microcode
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi m
                                 mx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs 
                                 bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_c
                                 pl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_
                                 timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs i
                                 bpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep 
                                 bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
cmake version 3.16.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Number of processors = 4
Linux cca-erik 5.6.0-2-amd64 #1 SMP Debian 5.6.14-2 (2020-06-09) x86_64 GNU/Linux
NODE PATH    = /home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/bin/node
NODE VERSION = v8.17.0
NODE         = linux@x64
NPM VERSION  = 6.13.4

CURRENT BRANCH  = 
Publishing native platform Binary Package? -> true

> [email protected] install /home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
make: Entering directory '/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/build'
  CXX(target) Release/obj.target/occ/src/all.o
make: g++: No such file or directory
make: *** [occ.target.mk:131: Release/obj.target/occ/src/all.o] Error 127
make: Leaving directory '/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 5.6.0-2-amd64
gyp ERR! command "/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/bin/node" "/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/lib/binding/occ.node" "--module_name=occ" "--module_path=/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/lib/binding" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v57"
gyp ERR! cwd /home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/bin/node /home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/lib/binding/occ.node --module_name=occ --module_path=/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:915:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 5.6.0-2-amd64
node-pre-gyp ERR! command "/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/bin/node" "/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ
node-pre-gyp ERR! node -v v8.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/bin/node /home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/nodeenv/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/lib/binding/occ.node --module_name=occ --module_path=/home/ceremcem/sync/curr-projects/aktos/aecad/node_modules/node-occ/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ceremcem/.npm/_logs/2020-08-05T18_37_34_517Z-debug.log

I tried to build natively, then I created a virtual environment (with nodeenv) but still no luck.

TypeError: Cannot read property 'prototype' of undefined(Node.js)

This example showing creation of basic shapes using node.js ...

var occ = require('occ')
// construct a box
var box = occ.makeBox([0,0,0],[100,100,50])
// construct a cylinder
var cyl = occ.makeCylinder([50,50,-10],[50,50,60],40)
// cut the box with cylinder
box = occ.cut(box,cyl)
// save result to a STEP file
occ.writeSTEP("somefile.step",box)

I am going to run the above program using node.js but I am getting this error ..

D:\node-file>node test.js
adding occ.Mesh.prototype.toJSON function
D:\node-file\node_modules\occ\lib\mesh.js:17
 occ.Mesh.prototype.toJSON = function() {
TypeError: Cannot read property 'prototype' of undefined
at Object.exports.init (D:\node-file\node_modules\occ\lib\mesh.js:17:11)
at Object.<anonymous> (D:\node-file\node_modules\occ\lib\occ.js:10:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (D:\node-file\test.js:1:73)
at Module._compile (module.js:460:26)

How to solve this issue? Any suggestion?

Some errord happend when build node-occ

I build on Ubuntu 18.04, when I execute command 'node-gyp build', there comes follow errs:
gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:340:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-20-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure"
gyp ERR! cwd /home/sheldonwu/WXD/node-occ
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
I try I for some times but it cannot be fixed, then if I run 'node-gyp build' there still errs.

Does not working in both linux and windows. Always pulling error while "npm install" stage

[email protected] preinstall C:\projects1\node-occ\node-occ

node build.js

[email protected] install C:\projects1\node-occ\node-occ
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EEXIST: file already exists, mkdir 'C:\projects1\node-occ\node-occ\lib\binding'
Warning: Missing input files:
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKOffset.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKG3d.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKGeomAlgo.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKBool.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKSTEP209.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKBRep.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKSTEPAttr.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKPrim.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKShHealing.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKBO.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKMesh.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKSTEPBase.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKTopAlgo.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKSTEP.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKMath.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKXSBase.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKG2d.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKGeomBase.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKFillet.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKernel.dll
C:\projects1\node-occ\node-occ\build..\occt-7.2.0\win64\vc14\bin\TKSTL.dll
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
all.cc
win_delay_load_hook.cc
c:\projects1\node-occ\node-occ\src\occ.h(4): fatal error C1083: Cannot open
include file: 'Standard_Version.hxx': No such file or directory (compiling s
ource file ..\src\all.cc) [C:\projects1\node-occ\node-occ\build\occ.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\shibin.m\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:190:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\shibin.m\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\projects1\node-occ\node-occ\lib\binding\occ.node" "--module_name=occ" "--module_path=C:\projects1\node-occ\node-occ\lib\binding" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v48"
gyp ERR! cwd C:\projects1\node-occ\node-occ
gyp ERR! node -v v6.17.1
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\shibin.m\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\projects1\node-occ\node-occ\lib\binding\occ.node --module_name=occ --module_path=C:\projects1\node-occ\node-occ\lib\binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v48' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\projects1\node-occ\node-occ\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:920:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\projects1\node-occ\node-occ\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\projects1\node-occ\node-occ
node-pre-gyp ERR! node -v v6.17.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\shibin.m\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\projects1\node-occ\node-occ\lib\binding\occ.node --module_name=occ --module_path=C:\projects1\node-occ\node-occ\lib\binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v48' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shibin.m\AppData\Roaming\npm-cache_logs\2019-07-19T12_02_40_073Z-debug.log
error2
error3

Always pulling these errors when using "npm install"

FYI: may need to run ldconfig [not a bug]

Two tips on teh README, one minor one real:

  1. npm install appears to run node-gyp configure and node-gyp build automagically.
  2. I needed to run ldconfig after the build but before I could run the tests (or anything else).

Certain operations are defined but not implemented

Hi,

A few operations have not been implemented and exposed, E.g. applyTransform or scale in Base.h. Any plans of implementing them?

Also, will be great if you could provide some examples of how to extrude faces?

Regards

There were something wrong with the Sample project

1 There is not sample folder in node-occ.
2 So, I clone node-occ-sample into node-occ.
3 when I run 'npm install' in 'node-occ-sample' folder, there are 2 404 fatals, node can not find the right version node-occ files.
4 So, I download 'occ-v0.2.0-node-v57-win32-x64.tar.gz' manually, then copy dll files into sample folder then npm install can finish.
5 But I cannot find app.js file in 'node-occ-sample' folder.
6 So I try to run client.js, but the server is not start.....I don't know how to go on...

Unable to install in windows

Tried building in windows PC with

npm install node-occ

output

> [email protected] install D:\projects\current\Struct\node_modules\node-occ
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/openwebcad/node-occ/releases/download/0.3.0/occ-v0.3.0-node-v72-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp)

Fails when also tried building from source.

Getting Error

I am getting this error trying to install this.

npm install node-occ
npm WARN package.json [email protected] No repository field.

[email protected] install C:\Users\Scott\Source\Workspaces\Node-OCC\Node-OCC\Node-OCC\node_modules\node-occ
node-gyp rebuild
C:\Users\Scott\Source\Workspaces\Node-OCC\Node-OCC\Node-OCC\node_modules\node-occ>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-occ package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-occ
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "node-occ"
npm ERR! cwd C:\Users\Scott\Source\Workspaces\Node-OCC\Node-OCC\Node-OCC
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
install node-occ completed with errors

Build is failing with ELIFECYCLE

If somehow lib/binding directory is changed to a file, build process fails with:

Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/aea/aecad/node_modules/node-occ/lib/binding/occ.node --module_name=occ --module_path=/home/aea/aecad/node_modules/node-occ/lib/binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

This case has occurred on two distinct computers.

build fails: node-gyp not finding OCE headers

Interesting project. Working with OCE is always challenging, but I'll ask this anyway.

Machine is debian jessie.

I have built OCE from source (tried a 0.15 checkout and then switched to 0.13 -- same problem with both) and here is the problem when trying to build the wrappers:

$ npm install
> [email protected] install /home/cmundi/Projects/node-occ
> node-gyp rebuild

make: Entering directory `/home/cmundi/Projects/node-occ/build'
  CXX(target) Release/obj.target/occ/src/Base.o
In file included from ../src/Base.h:3:0,
                 from ../src/Base.cc:1:
../src/OCC.h:4:32: fatal error: Standard_Version.hxx: No such file or directory
 #include <Standard_Version.hxx>
                                ^
compilation terminated.
make: *** [Release/obj.target/occ/src/Base.o] Error 1
make: Leaving directory `/home/cmundi/Projects/node-occ/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11-2-amd64
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/cmundi/Projects/node-occ
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

I'm not very familiar with node-gyp but I read the binding.gyp file and added the path for Standard_Version.hxx in the OCE source tree to the include_dirs section. Of course I soon found myself adding a bunch of OCE directories. And of course I was hacking them in one at a time between compiles as ../oce/src/whatever which is both annoying and hackish. I got tired of adding directories one at a time and stopped. Surely the OCE project exports an amalgamated set of headers to a single directory?

Thanks for any help.

FYI: Browser compatibility [not a bug]

Probably anyone reading this already knows their way around WebGL and isn't running a 7-year-old video card like me. But just in case someone stumbles into this...

The version of Chrome I'm using now (latest = 33.0.1750.152) refuses to support WebGL on my old nVidia GeForce 8800GT -- at least with the nouveau driver.

Firefox is perfectly happy to do WegGL for me. :)

Build error on solid.cc - cannot convert from 'v8::Primitive *' to 'v8::Object *volatile '

Hi there,

Looks like the current node-occ/master don't build against node 0.12.2, at least on Windows with msvc12 (visual studio 2013) and msvc10 (Windows sdk 7.1 / VS2010).

The full trace is:

Solid.cc
.node-gyp\0.12.2\deps\v8\include\v8.h(596): error C2440: '=' : cannot convert from 'v8::Primitive *' to 'v8::Object *volatile ' [C:\node-occ\build\occ.vcxproj]
  Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
  .node-gyp\0.12.2\deps\v8\include\v8.h(592) : see reference to function template instantiation 'void v8::NonCopyablePersistentTraits<T>::Uncompilable<v8::Object>(void)' being compiled with [T=v8::Object]
  .node-gyp\0.12.2\deps\v8\include\v8.h(5826) : see reference to function template instantiation 'void v8::NonCopyablePersistentTraits<T>::Copy<v8::Object,v8::NonCopyablePersistentTraits<T>>(const v8::Persistent<T> &,v8::Persistent<T> *)' being compiled with [T=v8::Object]
  .node-gyp\0.12.2\deps\v8\include\v8.h(657) : see reference to function template instantiation 'void v8::Persistent<T>::Copy<v8::Object,v8::NonCopyablePersistentTraits<T>>(const v8::Persistent<T> &)' being compiled with [T=v8::Object]
  .node-gyp\0.12.2\deps\v8\include\v8.h(656) : while compiling class template member function 'v8::Persistent<T>::Persistent(const v8::Persistent<T> &)' with [T=v8::Object]
  .node-gyp\0.12.2\src\node_object_wrap.h(132) : see reference to class template instantiation 'v8::Persistent<T>' being compiled with [T=v8::Object]

Solid.cc line 525: v8::Object doesn't seem to be what's expected according to v8.h.

Am I the only one in that situation? If yes, what do you think am I missing there?
Btw thanks @erossignon for this set of bindings, can't wait to being able to hack on it.

Build error in node-gyp build

Hi,

I am trying to build node-occ on ubuntu and get following error during node-gyp build command. Any help is appreciated.

/usr/local/include/oce/TCollection_Sequence.lxx:31:8: note: in expansion of macro ‘TCollection_Sequence’
inline TCollection_Sequence::TCollection_Sequence(const TCollection_Sequence& theOther)
^
../src/ShapeFactory.cc: At global scope:
../src/ShapeFactory.cc:12:8: error: ‘Primitives_Direction’ was not declared in this scope
char m(Primitives_Direction p)
^
../src/ShapeFactory.cc:13:1: error: expected ‘,’ or ‘;’ before ‘{’ token
{
^
make: *** [Release/obj.target/occ/src/ShapeFactory.o] Error 1

writeSTL is not implemented?

Am I right, that writeSTL is not implemented, as I get only empty STL file with text header and tests are missing for this method? Or is just something broken at my side?

Is this library is ever working ?

Hi.
Wanted to test this library (Ubuntu) but I can't install it, the tutorial seems to be corrupted, there is no prepare_build.sh file at all.

Thank you.

occt support?

Hi,
I wonder if OpenCascade 7.3.0 and above could be used instead of OCE 0.17.

Best
C

getting error on use

When I try and run the example or anything that uses the library I get the following error

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: libTKBO.so.7: cannot open shared object file: No such file or directory
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (PROJECT ROOT/node_modules/node-occ/lib/bindings.js:1:80)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Symbol not found: __ZNK18Standard_Transient11ShallowDumpERSo

Hi! node-occ looks like a great node module for CAD!
I'm trying to use it on my osx 10.9 with the current oce repo. Everything compiles fine (I just had to comment out -lTKCAF in binding.gyp as this file is not generated)

But I'm facing an issue when I try to run the mocha tests :

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: dlopen(/Users/kikko/Dev/cad/node-occ/build/Release/occ.node, 1): Symbol not found: __ZNK18Standard_Transient11ShallowDumpERSo
  Referenced from: /Users/kikko/Dev/cad/node-occ/build/Release/occ.node
  Expected in: dynamic lookup

at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/kikko/Dev/cad/node-occ/lib/bindings.js:1:80)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/kikko/Dev/cad/node-occ/lib/occ.js:4:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/kikko/Dev/cad/node-occ/test/test_csg.js:3:11)
    [...etc.]

I'm very new to OpenCascade and gyp so I'm not sure where exactly this issue comes from.

Build node-occ on OSX

Trying to build/test node-occ on OSX 10.6.8, I get the following error:

$ npm install
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/should
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/should

> [email protected] install /Users/thomas/Devel/node-occ
> node-gyp rebuild

  CXX(target) Release/obj.target/occ/src/Base.o
../src/NodeV8.h: In function ‘v8::Handle ee(v8::Local, const v8::AccessorInfo&) [with T = Base, T1 = v8::String, T2 = const char*, T2 (T::* func)() = &Base::shapeType]’:
../src/Base.cc:318:   instantiated from here
../src/NodeV8.h:39: error: exception handling disabled, use -fexceptions to enable
make: *** [Release/obj.target/occ/src/Base.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/thomas/Devel/node-occ
gyp ERR! node -v v0.10.10
gyp ERR! node-gyp -v v0.9.6
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Help Required

Hi All,

I'm very new to occ and js can some one guide me of how to use occ lib and compile sample

Regards
Srinag

Color issue in Python.

First of all I am using this below code to read data from STEP file to generate 3D object but I am not able to set the color of this shape.
Every time its showing only default color.

            from __future__ import print_function
            from OCC.TCollection import TCollection_ExtendedString
            from OCC.XCAFDoc import *
            from OCC.TDocStd import Handle_TDocStd_Document
            from OCC.TopoDS import *
            from OCC.Quantity import *
            from OCC.XCAFApp import XCAFApp_Application
            from OCC.XCAFDoc import (XCAFDoc_DocumentTool_ShapeTool,
                                     XCAFDoc_DocumentTool_ColorTool,
                                     XCAFDoc_DocumentTool_LayerTool,
                                     XCAFDoc_DocumentTool_MaterialTool,
                                     XCAFDoc_ColorGen)
            from OCC.STEPCAFControl import STEPCAFControl_Reader
            from OCC.Quantity import Quantity_Color
            from OCC.IFSelect import IFSelect_RetDone
            from OCC.TDF import TDF_LabelSequence

            from OCC.Display.SimpleGui import init_display
            from OCC.Display.WebGl import webgl_renderer

            filename = './models/test.STEP'
            _shapes = []

            # create an handle to a document
            h_doc = Handle_TDocStd_Document()

            # Create the application
            app = XCAFApp_Application.GetApplication().GetObject()
            app.NewDocument(TCollection_ExtendedString("MDTV-CAF"), h_doc)

            # Get root assembly
            doc = h_doc.GetObject()
            h_shape_tool = XCAFDoc_DocumentTool_ShapeTool(doc.Main())
            l_colors = XCAFDoc_DocumentTool_ColorTool(doc.Main())
            l_layers = XCAFDoc_DocumentTool_LayerTool(doc.Main())
            l_materials = XCAFDoc_DocumentTool_MaterialTool(doc.Main())

            step_reader = STEPCAFControl_Reader()
            step_reader.SetColorMode(True)
            step_reader.SetLayerMode(True)
            step_reader.SetNameMode(True)
            step_reader.SetMatMode(True)

            status = step_reader.ReadFile(filename)
            if status == IFSelect_RetDone:
                step_reader.Transfer(doc.GetHandle())
            comps = TDF_LabelSequence()
            labels = TDF_LabelSequence()
            color_labels = TDF_LabelSequence()

            #print(h_shape_tool.GetObject().UpdateAssembly(labels))

            shape_tool = h_shape_tool.GetObject()
            h_shape_tool.GetObject().GetFreeShapes(labels)

            print("Number of shapes at root :%i" % labels.Length())
            for i in range(labels.Length()):
                sub_shapes_labels = TDF_LabelSequence()
                print("Is Assembly :", shape_tool.IsAssembly(labels.Value(i+1)))
                sub_shapes = shape_tool.GetSubShapes(labels.Value(i+1), sub_shapes_labels)
                l_colors.GetObject().GetColors(color_labels)
                print("Number of subshapes in the assemly :%i" % sub_shapes_labels.Length())
                for j in range(20):
                    a_shape = h_shape_tool.GetObject().GetShape(sub_shapes_labels.Value(j+1))
                    #l_colors.GetObject().GetColors(color_labels)
                    #l_colors.GetObject().SetColor(Quantity_Color(Quantity_NOC_BLACK))
                    l_colors.GetObject().UnSetColor
                    red = Quantity.Quantity_Color(Quantity.Quantity_NOC_RED)
                    green = Quantity.Quantity_Color(Quantity.Quantity_NOC_GREEN)
                    l_colors.GetObject().SetColor(a_shape, red, XCAFDoc_ColorGen)
                    l_colors.GetObject().SetColor(a_shape, green, XCAFDoc_ColorGen)

                    _shapes.append(a_shape)
                    #print(sub_shapes_labels.Value(j+1).Data())

            #
            # Display
            #
            display, start_display, add_menu, add_function_to_menu = init_display()
            #display.FitAll()
            #display.DisplayColoredShape(_shapes, update=True)
            display.DisplayShape(_shapes, update=True)
            start_display()

            #my_renderer = webgl_renderer.WebGlRenderer(background_color="#123345")
            #my_renderer.DisplayShape(a_shape)

Any suggestion? Thanx

Is this project related to OpenJScad?

Its probably a trivial question, but it's my first time to "venture" into 3D modelling related stuff and because I usually do JavaScript, I'd like to have some synergy effects where possible.

I found blender to have a plugin to interface with OpenJScad, but now also stumbled upon node-occ.
I'm really new and lack all the fundamental basics that i should probably know about, hence my probably trivial question.

What is the background of this project? Why does it exist? How does it compare to alternatives :-)
If you could point me at some learning resources or give me a small overview so I have some orientation, that would be neat ;-)

occ.makeBox is not a function

I've compiled node-occ and tried to run the example code in README. Here is the contents of example.js:

var occ = require('occ')

// construct a box
var box = occ.makeBox([0,0,0],[100,100,50])

// construct a cylinder
var cyl = occ.makeCylinder([50,50,-10],[50,50,60],40)

// cut the box with cylinder
box = occ.cut(box,cyl)

// save result to a STEP file
occ.writeSTEP("somefile.step",box)

and here is the error:

$ node example.js 
/home/ceremcem/sync/dev/node-occ-example/example.js:4
var box = occ.makeBox([0,0,0],[100,100,50])
              ^

TypeError: occ.makeBox is not a function
    at Object.<anonymous> (/home/ceremcem/sync/dev/node-occ-example/example.js:4:15)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

Node V4+

Hi, I just tried this out with Node V4.1 on Ubuntu. It fails due to Nan issues. Actually tons of javascript codes have failed with the shift to Node V4 with the same issue. Just a couple of lines of the error provided below...

make: Entering directory '/home/john/PROJECTS/OpenCascadeJS/node-occ/build'
CXX(target) Release/obj.target/occ/src/Base.o
In file included from ../src/NodeV8.h:17:0,
from ../src/Base.h:2,
from ../src/Base.cc:1:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template v8::Local Nan::imp::NanEnsureHandleOrPersistent(const v8::Local&)’
NAN_INLINE v8::Local NanEnsureHandleOrPersistent(const v8::Local &val) {
^
../node_modules/nan/nan.h:319:17: note: ‘template v8::Handle Nan::imp::NanEnsureHandleOrPersistent(v8::Handle&)’ previously declared here
v8::Handle NanEnsureHandleOrPersistent(const v8::Handle &val) {
...

editor and autocompletion/snippet experiments

Hi @erossignon ,

I'm experimenting with a new web interface for node-occ where the editor is based on http://ace.c9.io.

Experimenting with snippets and autocompletion features in it. Then along the way I noticed your sample app pulls in an ace.js script at https://github.com/erossignon/node-occ/blob/master/sample/views/sample.ejs#L66 with

<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

Is this a particular ace version of the same editor? Your front page mentions codemirror yet I see scripts commented out so I can assume you are moving to ace?

My current configuration of ace has two snippets working and I'm adding the rest of the node-occ api functions:

<script>
    require.config({paths: { ace: "js/lib/ace"}});
    require(["ace/ace", "ace/ext/statusbar", "ace/ext/language_tools", "ace/snippets"], function(ace) {
            console.log("This is the testace module");
            var editor = ace.edit("editor");
            var StatusBar = ace.require("ace/ext/statusbar").StatusBar;
            // create a simple selection status indicator
            var statusBar = new StatusBar(editor, document.getElementById("statusBar"));
            editor.setTheme("ace/theme/twilight");
            editor.session.setMode("ace/mode/javascript");
            editor.setOptions({
                enableBasicAutocompletion: true,
                enableSnippets: true
            });
            var langTools = ace.require("ace/ext/language_tools");
            var snippetManager = langTools.snippetManager;
            var snippetCompleter = {
                getCompletions: function(editor, session, pos, prefix, callback) {
                    var completions = [];
                    callback(null, [{caption: "makeBox", snippet: "makeBox(\[${1:x1}, ${2:y1}, ${3:z1}\], \[${4:x2}, ${5:y2}, ${6:z2}\]);", meta: "csg", type: "snippet"},
                                    {caption: "makeTorus", snippet: "makeTorus(\[${1:x1}, ${2:y1}, ${3:z1}\], \[${4:x2}, ${5:y2}, ${6:z2}\], ${7:r0},${8:rs});", meta: "csg", type: "snippet"}]);
                },
                getDocTooltip: function(item) {
                    if (item.type == "snippet" && !item.docHTML) {
                        item.docHTML = [
                            "<b>", langTools.escapeHTML(item.caption), "</b>", "<hr></hr>",
                            langTools.escapeHTML(item.snippet)
                        ].join("");
                    }
                }
            };          
            langTools.addCompleter(snippetCompleter);           
            var csgCompleter = {
                getCompletions: function(editor, session, pos, prefix, callback) {
                    if (prefix.length === 0) { callback(null, []); return }
                            // wordList like [{"word":"flow","freq":24,"score":300,"flags":"bc","syllables":"1"}]
                            callback(null, [{name: "makeBox", value: "makeBox([x1, y1, z1], [x2, y2, z2])", score: 300, "syllables":"2", meta: "csg"}]);
                }
            }
            //langTools.addCompleter(csgCompleter);         
            editor.setValue("Hello\n\tworld!", -1);
        }
    );
</script>

Would you prefer I fork and work up a demo of what I'm doing? Yet my dependencies are a bit different because of other experiments; koa based for one. Or I was thinking there could eventually be a node-occ.gui or other related dot name repository.

I also built a jstree http://www.jstree.com/ based slideout panel of a folder interface to provide a project system. And made a more heads up display based on the threejs. Have plans to add math geometry assisters.

Also github will serve pages from a special branch in the repository. I set up for one of my projects http://rycole.com/hdf5.node/ Jekyll http://jekyllrb.com/ based tutorials and api documents using http://bruth.github.io/jekyll-docs-template/. Would you like such pages setup for node-occ?

v0.11.13-pre and V8 3.25.30 refurbishing

Hi,

Been learning node and native interface by upgrading for nodejs v0.11.13-pre and V8 3.25.30 pulled as recently as today.

Making good progress. Some unit tests are succeeding. Mainly have debugging on the prototyping of methods. The properties work; just not the EXPOSE_METHOD's yet.

I've got the prototype methods in node-addon-examples for 6_object_wrap and 9_async_work working and am still debugging why in this project not getting prototype methds to be defined; Hitting one main error for example:

  1) testing solid construction makeBox with 2 points should have an outerShell with 6 faces:
     TypeError: undefined is not a function

while testing:
mocha ./test/test_solid.js
The example app stands up but of course the 'Update Geometry' doesn't function yet.

I can provide a patch if you have interest in making this project use the latest node and V8.

create a Mesh from scratch

Hello. Is there a way to create a mesh from a list of vertices and faces so it can be used as a shape for boolean operations?

Looks like new occ.Mesh() is available but I don't see how too actually build the mesh.

not able to do npm install on node occ - getting following error

node-pre-gyp ERR! Tried to download(404): https://github.com/openwebcad/node-occ/releases/download/0.2.2/occ-v0.2.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at Object.failNoPython (C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at Object. (C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\lib\binding\occ.node" "--module_name=occ" "--module_path=C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\lib\binding"
gyp ERR! cwd C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ
gyp ERR! node -v v6.11.5
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\lib\binding\occ.node --module_name=occ --module_path=C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\lib\binding' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:920:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ
node-pre-gyp ERR! node -v v6.11.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\lib\binding\occ.node --module_name=occ --module_path=C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\lib\binding' (1)

npm WARN [email protected] requires a peer of ajv@^5.0.0 but none was installed.
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-occ package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-occ
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-occ
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\chinky\Desktop\nGitRepo\node-occ\projects\node-occ\npm-debug.log

help with load brep

Hi Etienne,

Sorry to post an issue here, I don't know where to ask a question.
I've setup the server and can create shapes using the web command lie.

I'm not familiar with node-js, could you please show an simple example about how to load a brep file (exported from occ) and render it in the web?

Thanks so much!

Ling

I not compile

on ubuntu

installing nodejs and gyp utility to build extensions

sudo apt-get install nodejs npm
sudo npm install node-pre-gyp -g
sudo npm install mocha -g

#installing cmake
sudo apt-get install cmake cmake-curses-gui g++ build-essential

------------------------------------

git clone --recursive https://github.com/erossignon/node-occ.git
cd node-occ
sh prepare_build.sh
npm install
node-pre-gyp configure
node-pre-gyp build
mocha

down last vision, prepare_build.sh 's file is not exist. The result that sh prepare_node.sh is
2018-04-09 20_18_15-ubuntu64 - oracle vm virtualbox

How do I move a face?

Tried using code like following, but does not seem to work. Any suggestions appreciated.

//Added moveFace method on Solid
NAN_METHOD(Solid::moveFace) 
{
    NanScope();

    Solid* pThis = ObjectWrap::Unwrap<Solid>(args.This());
    Face* pf = NULL;

    if(!extractArg(args[0],pf)) {
      NanThrowError("invalid arguments moveFace : expecting <FACE>");    
      NanReturnUndefined();
    }

    gp_Trsf transformation;
    double x=0,y=0,z=0;

    ReadPoint(args[1],&x,&y,&z);    
    transformation.SetTranslation(gp_Vec(x,y,z));

    //This does not work
    //Event BRepTools_ReShape does not work.   
    pf->face().Move(transformation);  
    NanReturnUndefined();
}

../src/NodeV8.h:68:5: error: cannot use 'try' with exceptions disabled

Hi,
I'm trying to compile it for Mac OS. When I execute the npm install, the compiler shows me that error:

../src/NodeV8.h:68:5: error: cannot use 'try' with exceptions disabled

Do you have any idea what can be the problem? I was trying to fix it in the binding.gyp file without success.

Thanks,

Unable to install node-occ with npm

Hello,
I am not able to install node-occ using npm. Could you provide any help on this regard? Please see below my error log. I am using Node v.10.15.3. Thank you!

PS C:\Users\giuli\Documents\3d-test\3d-test> npm install node-occ

> [email protected] install C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/openwebcad/node-occ/releases/download/0.3.0/occ-v0.3.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
Warning: Missing input files:
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKFillet.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKGeomBase.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKShHealing.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKG3d.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKXSBase.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKBool.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKSTEP209.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKBRep.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKBO.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKSTL.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKOffset.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKTopAlgo.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKernel.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKSTEPBase.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKPrim.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKGeomAlgo.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKG2d.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKMesh.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\src\all.cc
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKMath.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKSTEPAttr.dll
C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\build\..\occt-7.2.0\win64\vc14\bin\TKSTEP.dll
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  all.cc
  win_delay_load_hook.cc
c1xx : fatal error C1083: Cannot open source file: '..\src\all.cc': No such file or directory [C:\Users\giuli\Documents\3
d-test\3d-test\node_modules\node-occ\build\occ.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\giuli\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\giuli\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\giuli\\Documents\\3d-test\\3d-test\\node_modules\\node-occ\\lib\\binding\\occ.node" "--module_name=occ" "--module_path=C:\\Users\\giuli\\Documents\\3d-test\\3d-test\\node_modules\\node-occ\\lib\\binding" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\giuli\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\lib\binding\occ.node --module_name=occ --module_path=C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\lib\binding --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17763
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\giuli\\Documents\\3d-test\\3d-test\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ
node-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.9.1
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\giuli\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\lib\binding\occ.node --module_name=occ --module_path=C:\Users\giuli\Documents\3d-test\3d-test\node_modules\node-occ\lib\binding --napi_version=3 --node_abi_napi=napi' (1)
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\giuli\AppData\Roaming\npm-cache\_logs\2019-07-15T10_12_13_889Z-debug.log

window+npm install error

there are some build problem when i do the "npm install". then how to solve it?
ok,here are the error output.
D:\OCC\demo\mode-occ\node-occ\src\OCC.h(4,10): fatal error C1083: 无法打开包括文件: “Standard_Version.hxx”: No such file or
directory (编译源文件 ..\src\all.cc) [D:\OCC\demo\mode-occ\node-occ\build\occ.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\deng\AppData\Roaming\nvm\v14.17.0\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:376:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\deng\AppData\Roaming\nvm\v14.17.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=D:\OCC\demo\mode-occ\node-occ\lib\binding\occ.node" "--module_name=occ" "--module_path=D:\OCC\demo\mode-occ\node-occ\lib\binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd D:\OCC\demo\mode-occ\node-occ
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\deng\AppData\Roaming\nvm\v14.17.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\OCC\demo\mode-occ\node-occ\lib\binding\occ.node --module_name=occ --module_path=D:\OCC\demo\mode-occ\node-occ\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\deng\AppData\Roaming\nvm\v14.17.0\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:376:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19043
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\OCC\demo\mode-occ\node-occ
node-pre-gyp ERR! node -v v14.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.17.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\deng\AppData\Roaming\nvm\v14.17.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\OCC\demo\mode-occ\node-occ\lib\binding\occ.node --module_name=occ --module_path=D:\OCC\demo\mode-occ\node-occ\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\deng\AppData\Roaming\npm-cache_logs\2021-08-03T09_14_18_520Z-debug.log

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.