Comments (2)
We also have problem like this.
We use opencascade.js to write BREP. Now the question is : though BRepTools.Write_3 return "true", we don't know whether the file "a.brep" is created or not, since we didn't find "a.brep" in the specified file path. The code is below:
var shape = createSquare(this.openCascade, 10, 10, 10, 360, 1);
var brepStr = "a.brep";
var theProgress = new this.openCascade.Message_ProgressRange_1();
var result = this.openCascade.BRepTools.Write_3(shape,brepStr,theProgress)
console.log(result)
We don't know how to write brep file.
from opencascade.js.
We found solution. Maybe js doesn't offer methods to write file to disk, and the file that occ.js created is storaged in occ.js buffer or something else, so we can't find file in our disk. But we can read the file and get the String like below:
var theProgress = new this.openCascade.Message_ProgressRange_1();
var result = this.openCascade.BRepTools.Write_3(shape,"test",theProgress)
let brep = this.openCascade.FS.readFile("/" + "test", { encoding:"utf8" });
this.openCascade.FS.unlink("/" + "test");
console.log(result)
console.log(brep)
Also, when you send a absolute path to BRepTools.Write_3(), it will return false, since js may not write file to you disk path.
from opencascade.js.
Related Issues (20)
- Nuxt3 template
- Build emcc crashes HOT 4
- How to iterate over NCollection_List?
- MultiThreaded build on the browser gives errors related to node environment HOT 2
- CI costs too much time when building ocjs HOT 5
- Is there a better way to add cpp code? HOT 2
- How to import brep file with opencascade.js? HOT 1
- null function or function signature mismatch when building shell from solid HOT 2
- Custom Build: XCAFDoc_DocumentTool.ShapeTool is not a function
- Is It possible to export a image to SVG?
- can i modify or replace a shape for an assembly ? (Adding new shape replacing the old opencascade shape)
- How to config opencascade.js in next.js? HOT 1
- How to build only a few specific modules of occ
- Cannot bind the library with Vite HOT 1
- Noob question : about .step export
- Update opencascade to 7.8.0 HOT 2
- Few errors during custom build
- Project Maintenance Status? HOT 1
- Custom build no-exceptions.yml failed. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencascade.js.