Closed chessdenman closed 10 months ago
@chessdenman my suspicion is that this is a SceneKit issue rather than anything related to Euclid. What happens if you just load the STL file directly using SNCScene.init(url:)? https://developer.apple.com/documentation/scenekit/scnscene/1522660-init
I tried your code and it seemed to work fine for the couple of STL files I tested. Can you share the specific file you are trying to load? Perhaps there is something unusual about it?
wow that is so kind of you Here is the file I am such a beginner that if chatGPT can't help me out I get a bit stuck
Chess Denman
On Fri, Jan 26, 2024 at 12:04 AM Nick Lockwood @.***> wrote:
I tried your code and it seemed to work fine for the couple of STL files I tested. Can you share the specific file you are trying to load? Perhaps there is something unusual about it?
— Reply to this email directly, view it on GitHub https://github.com/nicklockwood/Euclid/issues/110#issuecomment-1911195040, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHY5IUJ3JSYPDPVDO4HHLYQLXJ3AVCNFSM6AAAAABCJOQTFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRGE4TKMBUGA . You are receiving this because you were mentioned.Message ID: @.***>
@chessdenman the file wasn't attached - you might need to upload it via the github issue page (https://github.com/nicklockwood/Euclid/issues/110) instead of an email attachment?
Failing that, if it's a plain text STL you can just paste the text into the form field.
1Cil.txt hi It doesn't like me uploading a .stl file so I have renamed it .txt it is an ASCII not a binary.
it is an ASCII not a binary.
This is actually a binary STL file (if you open it in a text editor you can see that it's not human readable data), but that wasn't why it's not appearing.
The problem is that because the model is quite large, it's outside the default clipping range for the viewport. This should fix it:
cameraNode.camera?.automaticallyAdjustsZRange = true
(or if you prefer, you could se the zNear
/zFar
properties explicitly based on the meshNode bounds)
Thanks so much. That is fantastically helpful. I am really enjoying the library. I have a massive (and unwieldy) python application that I use to generate gcode for a 3d printing application in clay. It links to blender at the last moment to display a representation of the pot in the form of an elipse that is extruded along the gcode tool path. When you print in clay the layers are visible at about 1mm so its helpful to see a visual representation of the final product.
The (somewhat over ambitious) masterplan is to rewrite the blender bit using Euclid
I think I have worked out how to get bits of cgal to work inside a swift program so that will allow for a fair bit of mesh analysis and processing.
Chess Denman
On Fri, Jan 26, 2024 at 11:16 AM Nick Lockwood @.***> wrote:
it is an ASCII not a binary.
This is actually a binary STL file (if you open it in a text editor you can see that it's not human readable data), but that wasn't why it's not appearing.
The problem is that because the model is quite large, it's outside the default clipping range for the viewport. This should fix it:
cameraNode.camera?.automaticallyAdjustsZRange = true
(or if you prefer, you could se the zNear/zFar properties explicitly based on the meshNode bounds)
— Reply to this email directly, view it on GitHub https://github.com/nicklockwood/Euclid/issues/110#issuecomment-1911910482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBHY5O6QPKSF2CEGV47VALYQOF77AVCNFSM6AAAAABCJOQTFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRHEYTANBYGI . You are receiving this because you were mentioned.Message ID: @.***>
Sorry for a raft of very basic questions
I am importing an STL file into Euclid using the script below
I am finding I can only see the mesh if I uncomment out the debug line. With that line uncommented I see the bounding box and the red imported mesh.
The STL file being imported is a standard one in plain text actually created from a program called onshape.
Can anyone help me with what I am doing wrong.
: