Closed karimall72 closed 6 years ago
Please indicate which flavor of JCSG you are referring to. It looks like you are using a fork. While these forks do often contain interesting new features, they are usually not as stable as the mainline version.
Have a look at the original code: https://github.com/miho/JCSG/blob/f2b4c4b6ee15a4f2958052e3e573119da97d56c9/src/main/java/eu/mihosoft/jcsg/CSG.java#L795
I'm closing this now. But if you have trouble with the mainline version (https://github.com/miho/JCSG/) let us know and we can reopen the issue.
Hello,
I am using version v0.5.7 (at least, I hope so, but I am not very familiar with Git, I have to learn).
I think the situation is the following : OBJ file generation works fine if you use:
ObjFile objF = new TestPolyhedron().toCSG().toObj();
objF.toFiles(Paths.get("testPolyhedron.obj"));
But you get into trouble if you use:
FileUtil.write(Paths.get("testPolyhedron.obj"), new TestPolyhedron().toCSG().toObjString());
It leads to a call to the method: public StringBuilder toObjString(StringBuilder sb) where the update of the indices list is not done.
The easiest fix would probably be to remove from the CSG API the methods toObjString() and toObjString(StringBuilder sb). One only way of doing one thing is enough ;)
Regards
Hello,
Currently, using the method toObjString(StringBuilder sb) {...} leads to a file whose content looks like:
Group
g v3d.csg
Vertices
v 0.0 10.0 0.0 v 2.0 10.0 0.0 v 2.0 5.0 0.0 v 10.0 5.0 0.0
Faces
Indices of faces are not written in the file. The issue can be easily solved by adding one line in a loop of the method (update of the indices list, see last line below):
Regards