Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jscad/OpenJSCAD.org
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @jscad/stl-serializer@2.1.18
Choose a base ref
...
head repository: jscad/OpenJSCAD.org
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @jscad/stl-serializer@2.1.19
Choose a head ref

Commits on Oct 6, 2024

  1. chore(release): Release : 2024 OCT 06

    z3dev authored Oct 6, 2024
    Copy the full SHA
    15a50a0 View commit details

Commits on Nov 2, 2024

  1. All deserializers must accept an ArrayBuffer *or* a string.

    CLI loads required files as binary (arraybuffer)
    Tests
    eldanb committed Nov 2, 2024
    Copy the full SHA
    56a96ba View commit details
  2. Fix webRequire

    eldanb committed Nov 2, 2024
    Copy the full SHA
    6dcb955 View commit details

Commits on Nov 5, 2024

  1. CR changes

    eldanb committed Nov 5, 2024
    Copy the full SHA
    ce2bfe9 View commit details

Commits on Nov 9, 2024

  1. fix(io-utils): added ensureString, updated io deserializers in order …

    …to accept buffers
    
    core: corrected registerDeserializer to read files as binary (buffers)
    z3dev authored Nov 9, 2024
    Copy the full SHA
    36b339f View commit details
  2. Copy the full SHA
    92bf842 View commit details
  3. Copy the full SHA
    eb3d326 View commit details
  4. Copy the full SHA
    0db5fe4 View commit details
  5. Copy the full SHA
    6639ec8 View commit details
  6. Copy the full SHA
    11bbfe2 View commit details
  7. Copy the full SHA
    1054f1d View commit details
  8. Copy the full SHA
    9b45f67 View commit details
  9. Copy the full SHA
    9e002fb View commit details
  10. Copy the full SHA
    351da0d View commit details
  11. Copy the full SHA
    9789cbf View commit details
  12. Copy the full SHA
    8c5b23c View commit details
  13. Copy the full SHA
    fc01384 View commit details
  14. style(modeling): changes to comply with lint

    z3dev committed Nov 9, 2024
    Copy the full SHA
    d89354d View commit details

Commits on Nov 10, 2024

  1. style(modeling): removed unused untested functions from OrthoNormalBasis

    z3dev committed Nov 10, 2024
    Copy the full SHA
    0070e9e View commit details
  2. style(all): changes to comply with lint

    z3dev authored Nov 10, 2024
    Copy the full SHA
    0e6215a View commit details
  3. chore(release): publish

     - @jscad/cli@2.3.4
     - @jscad/core@2.6.11
     - @jscad/3mf-serializer@2.1.13
     - @jscad/amf-deserializer@2.3.9
     - @jscad/amf-serializer@2.1.19
     - @jscad/dxf-deserializer@2.3.26
     - @jscad/dxf-serializer@2.1.19
     - @jscad/io-utils@2.0.29
     - @jscad/io@2.4.10
     - @jscad/json-deserializer@2.0.30
     - @jscad/json-serializer@2.0.29
     - @jscad/obj-deserializer@2.0.29
     - @jscad/obj-serializer@2.1.19
     - @jscad/stl-deserializer@2.1.26
     - @jscad/stl-serializer@2.1.19
     - @jscad/svg-deserializer@2.5.10
     - @jscad/svg-serializer@2.3.17
     - @jscad/x3d-deserializer@2.2.9
     - @jscad/x3d-serializer@2.4.9
     - @jscad/modeling@2.12.4
     - @jscad/regl-renderer@2.6.11
     - @jscad/vtree@2.0.30
     - @jscad/web@2.6.9
    z3dev committed Nov 10, 2024
    Copy the full SHA
    ce4978e View commit details
Showing with 1,858 additions and 1,686 deletions.
  1. +1 −1 .github/workflows/node.yml
  2. +2 −1 package.json
  3. +8 −0 packages/cli/CHANGELOG.md
  4. +74 −4 packages/cli/cli.conversions.test.js
  5. +3 −3 packages/cli/cli.js
  6. +7 −8 packages/cli/cli.parameters.test.js
  7. +4 −4 packages/cli/package.json
  8. +1 −1 packages/cli/src/generateOutputData.js
  9. BIN packages/cli/test_fixtures/stl_import/binary_stl.stl
  10. +4 −0 packages/cli/test_fixtures/stl_import/index.js
  11. +8 −0 packages/core/CHANGELOG.md
  12. +525 −516 packages/core/dist/jscad-core.min.js
  13. +4 −4 packages/core/package.json
  14. +11 −2 packages/core/src/io/registerExtensions.js
  15. +8 −0 packages/io/3mf-serializer/CHANGELOG.md
  16. +2 −2 packages/io/3mf-serializer/package.json
  17. +2 −4 packages/io/3mf-serializer/src/index.js
  18. +4 −4 packages/io/3mf-serializer/tests/serialize.test.js
  19. +8 −0 packages/io/amf-deserializer/CHANGELOG.md
  20. +3 −2 packages/io/amf-deserializer/package.json
  21. +3 −0 packages/io/amf-deserializer/src/index.js
  22. +8 −0 packages/io/amf-serializer/CHANGELOG.md
  23. +2 −2 packages/io/amf-serializer/package.json
  24. +8 −0 packages/io/dxf-deserializer/CHANGELOG.md
  25. +11 −6 packages/io/dxf-deserializer/index.js
  26. +3 −2 packages/io/dxf-deserializer/package.json
  27. +8 −0 packages/io/dxf-serializer/CHANGELOG.md
  28. +2 −2 packages/io/dxf-serializer/package.json
  29. +8 −0 packages/io/io-utils/CHANGELOG.md
  30. +9 −0 packages/io/io-utils/ensureString.js
  31. +2 −1 packages/io/io-utils/index.js
  32. +2 −2 packages/io/io-utils/package.json
  33. +8 −0 packages/io/io/CHANGELOG.md
  34. +18 −18 packages/io/io/package.json
  35. +8 −0 packages/io/json-deserializer/CHANGELOG.md
  36. +3 −1 packages/io/json-deserializer/index.js
  37. +4 −3 packages/io/json-deserializer/package.json
  38. +8 −0 packages/io/json-serializer/CHANGELOG.md
  39. +2 −2 packages/io/json-serializer/package.json
  40. +8 −0 packages/io/obj-deserializer/CHANGELOG.md
  41. +3 −0 packages/io/obj-deserializer/index.js
  42. +3 −2 packages/io/obj-deserializer/package.json
  43. +8 −0 packages/io/obj-serializer/CHANGELOG.md
  44. +2 −2 packages/io/obj-serializer/package.json
  45. +8 −0 packages/io/stl-deserializer/CHANGELOG.md
  46. +3 −3 packages/io/stl-deserializer/package.json
  47. +8 −0 packages/io/stl-serializer/CHANGELOG.md
  48. +2 −2 packages/io/stl-serializer/package.json
  49. +8 −0 packages/io/svg-deserializer/CHANGELOG.md
  50. +3 −2 packages/io/svg-deserializer/package.json
  51. +4 −2 packages/io/svg-deserializer/src/index.js
  52. +17 −17 packages/io/svg-deserializer/src/shapesMapGeometry.js
  53. +8 −8 packages/io/svg-deserializer/src/shapesMapJscad.js
  54. +3 −3 packages/io/svg-deserializer/tests/issue.1135.test.js
  55. +8 −0 packages/io/svg-serializer/CHANGELOG.md
  56. +2 −2 packages/io/svg-serializer/package.json
  57. +8 −0 packages/io/x3d-deserializer/CHANGELOG.md
  58. +3 −2 packages/io/x3d-deserializer/package.json
  59. +2 −1 packages/io/x3d-deserializer/src/index.js
  60. +8 −0 packages/io/x3d-serializer/CHANGELOG.md
  61. +2 −2 packages/io/x3d-serializer/package.json
  62. +8 −0 packages/modeling/CHANGELOG.md
  63. +2 −2 packages/modeling/dist/jscad-modeling.min.js
  64. +1 −1 packages/modeling/package.json
  65. +20 −15 packages/modeling/src/geometries/geom3/fromPointsConvex.test.js
  66. +0 −148 packages/modeling/src/maths/OrthoNormalBasis.js
  67. +2 −2 packages/modeling/src/primitives/polygon.js
  68. +1 −1 packages/modeling/src/primitives/polygon.test.js
  69. +8 −0 packages/utils/regl-renderer/CHANGELOG.md
  70. +2 −2 packages/utils/regl-renderer/package.json
  71. +8 −0 packages/vtree/CHANGELOG.md
  72. +4 −4 packages/vtree/package.json
  73. +8 −0 packages/web/CHANGELOG.md
  74. +872 −863 packages/web/dist/jscad-web.min.js
  75. +5 −5 packages/web/package.json
2 changes: 1 addition & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14', '16' ]
node: [ '16', '18' ]
name: Node ${{ matrix.node }} test
steps:
- uses: actions/checkout@v2
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -59,7 +59,8 @@
"**/old/",
"**/ui/csg-viewer",
"**/io/scad-deserializer",
"**/io/gcode-deserializer"
"**/io/gcode-deserializer",
"**/desktop"
],
"env": {
"browser": true,
8 changes: 8 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.3.4](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/cli@2.3.3...@jscad/cli@2.3.4) (2024-11-10)

**Note:** Version bump only for package @jscad/cli





## [2.3.3](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/cli@2.3.2...@jscad/cli@2.3.3) (2024-10-06)

**Note:** Version bump only for package @jscad/cli
78 changes: 74 additions & 4 deletions packages/cli/cli.conversions.test.js
Original file line number Diff line number Diff line change
@@ -8,19 +8,23 @@ test.afterEach.always((t) => {
// remove files
try {
if (t.context.file1Path) fs.unlinkSync(t.context.file1Path)
} catch (err) {}
} catch (err) { }

try {
if (t.context.file2Path) fs.unlinkSync(t.context.file2Path)
} catch (err) {}
} catch (err) { }

try {
if (t.context.file3Path) fs.unlinkSync(t.context.file3Path)
} catch (err) {}
} catch (err) { }

try {
if (t.context.file4Path) fs.unlinkSync(t.context.file4Path)
} catch (err) {}
} catch (err) { }

try {
if (t.context.file5Path) fs.unlinkSync(t.context.file5Path)
} catch (err) { }
})

test.beforeEach((t) => {
@@ -68,6 +72,56 @@ module.exports = { main, getParameterDefinitions }
return filePath
}

const createImportJscad = (id, extension) => {
const jscadScript = `// test script ${id} -- import
const main = () => {
return require('./test${id}.${extension}')
}
module.exports = { main }
`

const fileName = `./test${id}-import.jscad`
const filePath = path.resolve(__dirname, fileName)
fs.writeFileSync(filePath, jscadScript)
return filePath
}

const testBackImport = (t, testID, extension) => {
const cliPath = t.context.cliPath

const file4Path = createImportJscad(testID, extension)
t.context.file4Path = file4Path
t.true(fs.existsSync(file4Path))

const file5Name = `./test${testID}-import.stl`
const file5Path = path.resolve(__dirname, file5Name)
t.context.file5Path = file5Path
t.false(fs.existsSync(file5Path))

const cmd = `node ${cliPath} ${file4Path}`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(file5Path))
}

const runOnFixture = (t, fixtureName) => {
const inputFile = path.resolve(
__dirname,
path.join('test_fixtures', fixtureName, 'index.js'))

const outputFile = inputFile.replace('.js', '.stl')
t.context.file1Path = outputFile

t.false(fs.existsSync(outputFile))

const cmd = `node ${t.context.cliPath} ${inputFile}`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(outputFile))

return outputFile
}

test('cli (conversions STL)', (t) => {
const testID = 11

@@ -99,6 +153,8 @@ test('cli (conversions STL)', (t) => {
cmd = `node ${cliPath} ${file2Path} -o ${file3Path} -v -add-metadata false`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(file3Path))

testBackImport(t, testID, 'stl')
})

test('cli (conversions DXF)', (t) => {
@@ -132,6 +188,8 @@ test('cli (conversions DXF)', (t) => {
cmd = `node ${cliPath} ${file2Path} -of js`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(file3Path))

testBackImport(t, testID, 'dxf')
})

test('cli (conversions AMF)', (t) => {
@@ -165,6 +223,8 @@ test('cli (conversions AMF)', (t) => {
cmd = `node ${cliPath} ${file2Path} -of js`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(file3Path))

testBackImport(t, testID, 'amf')
})

test('cli (conversions JSON)', (t) => {
@@ -198,6 +258,8 @@ test('cli (conversions JSON)', (t) => {
cmd = `node ${cliPath} ${file2Path} -of js`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(file3Path))

testBackImport(t, testID, 'json')
})

test('cli (conversions SVG)', (t) => {
@@ -264,4 +326,12 @@ test('cli (conversions X3D)', (t) => {
cmd = `node ${cliPath} ${file2Path} -of js`
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(file3Path))

testBackImport(t, testID, 'x3d')
})

test('cli (import STL)', (t) => {
// const testID = 17

runOnFixture(t, 'stl_import')
})
6 changes: 3 additions & 3 deletions packages/cli/cli.js
Original file line number Diff line number Diff line change
@@ -76,13 +76,13 @@ generateOutputData(src, params, { outputFile, outputFormat, inputFile, inputForm
if (err) {
console.error(err)
} else {
logFileOutput(zipFilename)
logFileOutput(zipFilename)
}
})
})
} else {
for (let i = 0; i < outputData.length; i++) {
const filename = outputFile.replace(/\.(\w+)$/, `-part-${i + 1}-of-${outputData.length}.$1`)
const filename = outputFile.replace(/\.(\w+)$/, `-part-${i + 1}-of-${outputData.length}.$1`)
logFileOutput(filename)
writeOutput(filename, outputData[i])
}
@@ -97,7 +97,7 @@ generateOutputData(src, params, { outputFile, outputFormat, inputFile, inputForm
if (err) {
console.error(err)
} else {
logFileOutput(zipFilename)
logFileOutput(zipFilename)
}
})
})
15 changes: 7 additions & 8 deletions packages/cli/cli.parameters.test.js
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ const main = (params) => {
let ageom2 = primitives.ellipse()
let ageom3 = primitives.ellipsoid()
${multipart ? `return [ageom3, ageom3, ageom3]` : `return [apath2, ageom2, ageom3]`}
${multipart ? 'return [ageom3, ageom3, ageom3]' : 'return [apath2, ageom2, ageom3]'}
}
module.exports = { main, getParameterDefinitions }
@@ -215,7 +215,6 @@ test('cli (single input file, invalid jscad)', (t) => {
})
})


test('cli (single input file, multiple output files)', (t) => {
const testID = 7

@@ -239,7 +238,7 @@ test('cli (single input file, multiple output files)', (t) => {
const cliPath = t.context.cliPath

const cmd = `node ${cliPath} ${inputPath} -gp`
execSync(cmd, { stdio: [0,1,2] })
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(outputPath1))
t.true(fs.existsSync(outputPath2))
t.true(fs.existsSync(outputPath3))
@@ -257,13 +256,13 @@ test('cli (single multipart input file, zipped output file)', async (t) => {
const outputPath = path.resolve(__dirname, outputName)

t.false(fs.existsSync(outputPath))

t.context.outputPath = outputPath

const cliPath = t.context.cliPath

const cmd = `node ${cliPath} ${inputPath} -gp -z`
execSync(cmd, { stdio: [0,1,2] })
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(outputPath))

// check contents of zip file
@@ -281,18 +280,18 @@ test('cli (single input file, zipped output file)', async (t) => {
t.true(fs.existsSync(inputPath))

t.context.inputPath = inputPath

const outputName = `./test${testID}.zip`
const outputPath = path.resolve(__dirname, outputName)

t.false(fs.existsSync(outputPath))

t.context.outputPath = outputPath

const cliPath = t.context.cliPath

const cmd = `node ${cliPath} ${inputPath} -z`
execSync(cmd, { stdio: [0,1,2] })
execSync(cmd, { stdio: [0, 1, 2] })
t.true(fs.existsSync(outputPath))

// check contents of zip file
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jscad/cli",
"version": "2.3.3",
"version": "2.3.4",
"description": "Command Line Interface (CLI) for JSCAD",
"homepage": "https://openjscad.xyz/",
"repository": "https://github.com/jscad/OpenJSCAD.org",
@@ -36,9 +36,9 @@
"license": "MIT",
"dependencies": {
"@jscad/array-utils": "2.1.4",
"@jscad/core": "2.6.10",
"@jscad/io": "2.4.9",
"@jscad/modeling": "2.12.3",
"@jscad/core": "2.6.11",
"@jscad/io": "2.4.10",
"@jscad/modeling": "2.12.4",
"jszip": "^3.10.1"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/cli/src/generateOutputData.js
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ const generateOutputData = (source, params, options) => {
.then((solids) => {
const serializerOptions = Object.assign({ format: outputFormat }, params)
if (generateParts) {
let blobs = []
const blobs = []
for (let i = 0; i < solids.length; i++) {
blobs.push(solidsAsBlob(solids[i], serializerOptions))
}
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/cli/test_fixtures/stl_import/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

const main = () => require('./binary_stl.stl')

module.exports = { main }
8 changes: 8 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.6.11](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/core@2.6.10...@jscad/core@2.6.11) (2024-11-10)

**Note:** Version bump only for package @jscad/core





## [2.6.10](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/core@2.6.9...@jscad/core@2.6.10) (2024-10-06)

**Note:** Version bump only for package @jscad/core
Loading