@@ -103,11 +103,32 @@ export default class ReactNativeARKit extends Component {
103103 / >
104104 < ARKit .Model
105105 position= {{ x: - 0.2 , y: 0 , z: 0 , frame: ' local' }}
106+ scale= {0.01 },
106107 model= {{
107108 file: ' art.scnassets/ship.scn' , // make sure you have the model file in the ios project
108- scale: 0.01 ,
109109 }}
110110 / >
111+ < ARKit .Shape
112+ position= {{ x: - 1 , y: 0 , z: 0 }}
113+ eulerAngles= {{
114+ x: Math .PI ,
115+ }}
116+ scale= {0.01 }
117+ shape= {{
118+ // specify shape by svg! See https://github.com/HippoAR/react-native-arkit/pull/89 for details
119+ pathSvg: `
120+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
121+ <path d="M50,30c9-22 42-24 48,0c5,40-40,40-48,65c-8-25-54-25-48-65c 6-24 39-22 48,0 z" fill="#F00" stroke="#000"/>
122+ </svg>` ,
123+ pathFlatness: 0.1 ,
124+ // it's also possible to specify a chamfer profile:
125+ chamferRadius: 5 ,
126+ chamferProfilePathSvg: `
127+ <path d="M.6 94.4c.7-7 0-13 6-18.5 1.6-1.4 5.3 1 6-.8l9.6 2.3C25 70.8 20.2 63 21 56c0-1.3 2.3-1 3.5-.7 7.6 1.4 7 15.6 14.7 13.2 1-.2 1.7-1 2-2 2-5-11.3-28.8-3-30.3 2.3-.4 5.7 1.8 6.7 0l8.4 6.5c.3-.4-8-17.3-2.4-21.6 7-5.4 14 5.3 17.7 7.8 1 .8 3 2 3.8 1 6.3-10-6-8.5-3.2-19 2-8.2 18.2-2.3 20.3-3 2.4-.6 1.7-5.6 4.2-6.4"/>
128+ ` ,
129+ extrusion: 10 ,
130+ }}
131+ / >
111132 < / ARKit>
112133 < / View>
113134 );
@@ -276,6 +297,20 @@ SceneKit only supports `.scn` and `.dae` formats.
276297| ` eulerAngles ` | ` { x, y, z } ` |
277298| ` model ` | ` { file, node, scale, alpha } ` |
278299
300+ #### ` <ARKit.Shape /> `
301+
302+ Creates a extruded shape by an svg path.
303+ See https://github.com/HippoAR/react-native-arkit/pull/89 for details
304+
305+ ##### Props
306+
307+ | Prop | Type |
308+ | ---| ---|
309+ | ` position ` | ` { x, y, z } ` |
310+ | ` eulerAngles ` | ` { x, y, z } ` |
311+ | ` shape ` | ` { pathSvg, extrusion, pathFlatness, chamferRadius, chamferProfilePathSvg, chamferProfilePathFlatness } ` |
312+
313+
279314
280315## Contributing
281316
0 commit comments