This commit is contained in:
2025-07-13 15:59:09 +02:00
parent f8c3f17ab9
commit 019ee166bd
6 changed files with 5063 additions and 33 deletions

29
.idea/workspace.xml generated
View File

@@ -30,8 +30,6 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="70635ef7-86ab-4681-b98d-dc8e4999995b" name="Default Changelist" comment=""> <list default="true" id="70635ef7-86ab-4681-b98d-dc8e4999995b" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ui/App.svelte" beforeDir="false" afterPath="$PROJECT_DIR$/src/ui/App.svelte" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ui/Sidebar.svelte" beforeDir="false" afterPath="$PROJECT_DIR$/src/ui/Sidebar.svelte" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -78,20 +76,20 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"WebServerToolWindowFactoryState": "false", &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"ts.external.directory.path": "/home/ledda/Documents/Projects/soma/node_modules/typescript/lib", &quot;ts.external.directory.path&quot;: &quot;/home/ledda/Documents/Projects/soma/node_modules/typescript/lib&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/public" /> <recent name="$PROJECT_DIR$/public" />
@@ -165,6 +163,7 @@
<workItem from="1636284015038" duration="35000" /> <workItem from="1636284015038" duration="35000" />
<workItem from="1653769272575" duration="98000" /> <workItem from="1653769272575" duration="98000" />
<workItem from="1653769394515" duration="1008000" /> <workItem from="1653769394515" duration="1008000" />
<workItem from="1653822125424" duration="699000" />
</task> </task>
<servers /> <servers />
</component> </component>

5014
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -38,16 +38,21 @@
"sirv-cli": "^1.0.0", "sirv-cli": "^1.0.0",
"source-map-support": "^0.5.19", "source-map-support": "^0.5.19",
"three": "^0.128.0", "three": "^0.128.0",
"ts-node": "^10.9.1",
"typescript": "^4.4.0-dev.20210525" "typescript": "^4.4.0-dev.20210525"
}, },
"build": { "build": {
"appId": "de.djledda.somaesque", "appId": "de.djledda.somaesque",
"copyright": "Copyright © 2021 Daniel Ledda", "copyright": "Copyright © 2021 Daniel Ledda",
"win": { "win": {
"target": ["portable"] "target": [
"portable"
]
}, },
"linux": { "linux": {
"target": ["AppImage"] "target": [
"AppImage"
]
}, },
"icon": "./public/favicon.png", "icon": "./public/favicon.png",
"directories": { "directories": {

View File

@@ -237,21 +237,21 @@ export default class VoxelSpaceBigInt {
// [1, 0, 0] [x] [ x] // [1, 0, 0] [x] [ x]
// [0, 0, -1] * [y] = [-z] // [0, 0, -1] * [y] = [-z]
// [0, 1, 0] [z] [ y] // [0, 1, 0] [z] [ y]
private newIndexRotX(x: number, y: number, z: number) { newIndexRotX(x: number, y: number, z: number) {
return this.dims[2] * this.dims[1] * x + this.dims[1] * (this.dims[2] - 1 - z) + y; return this.dims[2] * this.dims[1] * x + this.dims[1] * (this.dims[2] - 1 - z) + y;
} }
// [ 0, 0, 1] [x] [ z] // [ 0, 0, 1] [x] [ z]
// [ 0, 1, 0] * [y] = [ y] // [ 0, 1, 0] * [y] = [ y]
// [-1, 0, 0] [z] [-x] // [-1, 0, 0] [z] [-x]
private newIndexRotY(x: number, y: number, z: number) { newIndexRotY(x: number, y: number, z: number) {
return this.dims[1] * this.dims[0] * z + this.dims[0] * y + (this.dims[0] - 1 - x); return this.dims[1] * this.dims[0] * z + this.dims[0] * y + (this.dims[0] - 1 - x);
} }
// [0, -1, 0] [x] [-y] // [0, -1, 0] [x] [-y]
// [1, 0, 0] * [y] = [ x] // [1, 0, 0] * [y] = [ x]
// [0, 0, 1] [z] [ z] // [0, 0, 1] [z] [ z]
private newIndexRotZ(x: number, y: number, z: number) { newIndexRotZ(x: number, y: number, z: number) {
return this.dims[0] * this.dims[2] * (this.dims[1] - 1 - y) + this.dims[2] * x + z; return this.dims[0] * this.dims[2] * (this.dims[1] - 1 - y) + this.dims[2] * x + z;
} }
@@ -354,4 +354,4 @@ export default class VoxelSpaceBigInt {
} }
return result; return result;
} }
} }

19
src/solver/js/tests.ts Normal file
View File

@@ -0,0 +1,19 @@
import VoxelSpaceBoolean from "../../VoxelSpaceBoolean";
(function test1() {
const spaces = [ 23n, 30n, 15n, 43n, 172n, 92n, 11n ].map((space: bigint) => {
return new VoxelSpaceBoolean({
id: 1,
dims: [3, 3, 3],
space,
cullEmpty: true,
});
});
console.log(spaces[0].at(0, 0, 1));
console.log(spaces[0].at(1, 0, 0));
console.log(spaces[0].at(2, 1, 2));
console.log(spaces[0].at(1, 2, 1));
console.log(spaces[0].at(0, 0, 0));
console.log(spaces[0].at(2, 2, 1));
})();

17
src/tests.ts Normal file
View File

@@ -0,0 +1,17 @@
import VoxelSpaceBigInt from "./VoxelSpaceBigInt";
(function test1() {
const spaces = [ 23n, 30n, 15n, 43n, 172n, 92n, 11n ].map((space: bigint) => {
return new VoxelSpaceBigInt({
id: 1,
dims: [3, 3, 3],
space,
cullEmpty: false,
});
});
console.log(spaces[1].rotated90('x').getRaw());
console.log(spaces[1].rotated90('y').getRaw());
console.log(spaces[1].rotated90('z').getRaw());
})();