@jscad/x3d-deserializer 3.0.0-alpha.0 → 3.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,6 +85,18 @@ test('deserialize X3D 3D triangle sets to JSCAD script', (t) => {
85
85
  t.is(countOf('transform', observed), 0)
86
86
  })
87
87
 
88
+ test('deserialize X3D 3D triangle sets with comma delimiters to JSCAD script', (t) => {
89
+ const inputPath = path.resolve(samplesPath, 'tests/TriangleSets_CommaMF.x3d')
90
+ const inputFile = fs.readFileSync(inputPath)
91
+
92
+ const observed = deserialize({ output: 'script', addMetaData: false }, inputFile)
93
+ t.is(countOf('createObjects', observed), 18)
94
+ t.is(countOf('points', observed), 12)
95
+ t.is(countOf('faces', observed), 12)
96
+ t.is(countOf('orientation', observed), 8)
97
+ t.is(countOf('polyhedron', observed), 4)
98
+ })
99
+
88
100
  test('deserialize X3D 3D transforms to JSCAD script', (t) => {
89
101
  const inputPath = path.resolve(samplesPath, 'tests/Transforms.x3d')
90
102
  const inputFile = fs.readFileSync(inputPath)
@@ -109,6 +121,18 @@ test('deserialize X3D 3D indexed triangle sets to JSCAD script', (t) => {
109
121
  t.is(countOf('transform', observed), 0)
110
122
  })
111
123
 
124
+ test('deserialize X3D 3D indexed triangle sets with comma delimiters to JSCAD script', (t) => {
125
+ const inputPath = path.resolve(samplesPath, 'tests/IndexedTriangleSets_CommaMF.x3d')
126
+ const inputFile = fs.readFileSync(inputPath)
127
+
128
+ const observed = deserialize({ output: 'script', addMetaData: false }, inputFile)
129
+ t.is(countOf('createObjects', observed), 24)
130
+ t.is(countOf('points', observed), 18)
131
+ t.is(countOf('faces', observed), 20)
132
+ t.is(countOf('orientation', observed), 12)
133
+ t.is(countOf('polyhedron', observed), 6)
134
+ })
135
+
112
136
  test('deserialize X3D 3D groups to JSCAD script', (t) => {
113
137
  const inputPath = path.resolve(samplesPath, 'tests/Groups.x3d')
114
138
  const inputFile = fs.readFileSync(inputPath)