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">
<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$/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>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -78,20 +76,20 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"ts.external.directory.path": "/home/ledda/Documents/Projects/soma/node_modules/typescript/lib",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;ts.external.directory.path&quot;: &quot;/home/ledda/Documents/Projects/soma/node_modules/typescript/lib&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/public" />
@@ -165,6 +163,7 @@
<workItem from="1636284015038" duration="35000" />
<workItem from="1653769272575" duration="98000" />
<workItem from="1653769394515" duration="1008000" />
<workItem from="1653822125424" duration="699000" />
</task>
<servers />
</component>

5012
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",
"source-map-support": "^0.5.19",
"three": "^0.128.0",
"ts-node": "^10.9.1",
"typescript": "^4.4.0-dev.20210525"
},
"build": {
"appId": "de.djledda.somaesque",
"copyright": "Copyright © 2021 Daniel Ledda",
"win": {
"target": ["portable"]
"target": [
"portable"
]
},
"linux": {
"target": ["AppImage"]
"target": [
"AppImage"
]
},
"icon": "./public/favicon.png",
"directories": {

View File

@@ -237,21 +237,21 @@ export default class VoxelSpaceBigInt {
// [1, 0, 0] [x] [ x]
// [0, 0, -1] * [y] = [-z]
// [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;
}
// [ 0, 0, 1] [x] [ z]
// [ 0, 1, 0] * [y] = [ y]
// [-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);
}
// [0, -1, 0] [x] [-y]
// [1, 0, 0] * [y] = [ x]
// [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;
}

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());
})();