Drawing 3D arcs and spirals in SceneKit

A recent question made me think about SceneKit again, and I remembered a problem that I had never solved.

My application displays antenna designs using SK. Most antennas use metal rods and mesh reflectors, so I used SCNCylinder for rods, SCNPlane for reflector, and SCNFloor for ground. All this took a couple of hours, and I'm completely noob in 3D.

But some antennas use wires bent into arcs or spirals, and I shot here and made crappy segmented objects using several cylinders from end to end. He looks dazzling.

Ideally, I need one object that displays an arc or spiral with a cylindrical cross section. Mostly SCNTorus, but with start and end angles. This post talks about using UIBezierPath in SK, but it uses it extrudeto create a ribbon shape. Is there a way to do something similar, but with a cylinder cross section (like a partial SCNTorus)?

I know that I can create a custom form by creating vertices (and normals, etc.), but I hope I have missed a simpler solution.

+3
source share
2 answers

, SCNShape. , . , , , , , , .

, chamferProfile - , , , , , , .

- . SCNShape - , , , . - , . SceneKit , , .

@HalMueller , . , - , y , . , , . ( .) , , : "" SceneKit - , , , .

- , , - (SCNGeometrySource). , . , Frenet, . (SCNGeometryElement), . (, , SO. , , ...)

+4

, .

- . , segmentCount SCNGeometry. ?

heightSegmentCount, : scenekit, .

SCNShape. , . SCNShape, , count count, , , . chamferRadius chamferProfile . , , .

+1
source

Source: https://habr.com/ru/post/1625906/


All Articles