scenekit - Basic Shapes Union / Intersection / Difference : too blind to see? -


i'm new arkit , after inspecting example code https://developer.apple.com/sample-code/wwdc/2017/placingobjects.zip wondered if there any posibility construct geometries in "union / intersection / difference"-manner primitives.

the following pseudo code should illustrate:

scnbox *boxgeometry = [scnbox boxwithwidth:1.0 height:1.0 length:1.0]; scnsphere *spheregeometry = [scnsphere spherewithradius:0.6];  scngeometry *sphereunionbox = [scngeometry union:spheregeometry with:boxgeometry]; scngeometry *sphereandboxintersection = [scngeometry intersect:spheregeometry and:boxgeometry]; scngeometry *spheresubstractedfrombox = [scngeometry substract:spheregeometry from:boxgeometry]; scngeometry *boxsubstractedfromsphere = [scngeometry substract:boxgeometry from:spheregeometry]; 

which should lead (after construction nodes these geometries , adding them scene) well-known , familiar combinations:

any broad hint appreciated, i'm stuck here.

scenekit doesn't offer apis constructive solid geometry (csg). there scngeometry apis build custom geometries, have figure out list of vertices , triangles yourself.


Comments

  1. I was looking for the same thing to, but found out it’s not supported. The reason being those operations are performed on solids whereas Scene kit is based on surfaces.

    In other words it has no concept of volume or anything so what looks like a sphere to you is really a bunch of planes composed of triangles or quads. In other words it has no way to know what to subtract because it doesn’t look at it as a solid like you and I do.

    ReplyDelete

Post a Comment