Skip to content

Commit

Permalink
Reworked polygon checking and overlap to use a subdivided grid for li…
Browse files Browse the repository at this point in the history
…near time
  • Loading branch information
HHogg committed Dec 1, 2024
1 parent 6d82406 commit 327d1b5
Show file tree
Hide file tree
Showing 232 changed files with 6,100 additions and 3,260 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/uuid-npm-9.0.1-39a8442bc6-39931f6da7.zip
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
56 changes: 33 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ strip = true
members = [
"workspaces/circular-sequence",
"workspaces/line-segment-extending",
"workspaces/spatial-grid-map",
"workspaces/tilings/src-rust/*",
"workspaces/wasm",
]
Expand All @@ -29,10 +30,12 @@ futures-util = "0.3.27"
insta = { version = "1.40.0", features = ["json"] }
log = "0.4.22"
pretty_assertions = "1.3.0"
rand = "0.8.4"
serde = { version = "1.0.210", features = ["derive"] }
serde_arrays = "0.1.0"
serde_json = "1.0.128"
serde-wasm-bindgen = "0.6.5"
serde_with = "3.9.0"
serde_with = "3.11.0"
sqlx = { version = "0.8.2", features = [
"chrono",
"macros",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
"typescript": "^5.0.4"
},
"dependencies": {
"preshape": "^19.1.0"
"preshape": "^19.1.5"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"noFallthroughCasesInSwitch": true,

/* Experimental */
"types": ["vite/client"]
"types": []
}
}
Binary file added workspaces/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion workspaces/circle-art/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dependencies": {
"@hogg/circle-intersections": "workspace:^",
"@hogg/common": "workspace:^",
"preshape": "^19.1.0",
"preshape": "^19.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
1 change: 0 additions & 1 deletion workspaces/circle-art/src/Presentation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const Presentation = ({
<EditorProvider data={data} onChange={onChange}>
<ProjectWindow
controls={<EditorControls />}
controlsPosition="top"
padding="x0"
tabs={
<ProjectTabs>
Expand Down
10 changes: 5 additions & 5 deletions workspaces/circle-intersections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"bitset": "^5.1.1",
"classnames": "^2.3.2",
"file-saver": "^2.0.5",
"framer-motion": "^10.16.16",
"lucide-react": "^0.294.0",
"preshape": "^19.1.0",
"framer-motion": "11.5.6",
"lucide-react": "0.445.0",
"preshape": "^19.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sat": "^0.9.0",
"uuid": "^9.0.1"
"uuid": "10.0.0"
},
"devDependencies": {
"@svgr/cli": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@swc/core": "^1.4.2",
"@types/file-saver": "^2.0.7",
"@types/sat": "^0.0.35",
"@types/uuid": "^9.0.7"
"@types/uuid": "10.0.0"
}
}
2 changes: 1 addition & 1 deletion workspaces/circular-sequence/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "circular-sequence"
name = "circular_sequence"
version = "0.0.0"
edition = "2021"
authors = ["Harry Hogg <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions workspaces/circular-sequence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"dependencies": {
"@hogg/common": "workspace:^",
"lucide-react": "0.439.0",
"preshape": "^19.1.0",
"lucide-react": "0.445.0",
"preshape": "^19.1.5",
"react": "^18.2.0",
"uuid": "10.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion workspaces/circular-sequence/src-rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pub use min_permutation::{get_min_permutation, reverse};
pub use sequence::{get_length, get_symmetry_index, insert, is_symmetrical, Sequence};
pub use sequence_store::SequenceStore;
pub use sort::{compare, sort};
pub use to_string::to_string;
pub use to_string::{to_string, to_string_one};
3 changes: 3 additions & 0 deletions workspaces/circular-sequence/src-rust/sequence.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use typeshare::typeshare;

#[path = "./sequence_tests.rs"]
#[cfg(test)]
mod tests;

#[typeshare]
pub type Sequence = [u8; 12];

/// Returns the length of a sequence.
Expand Down
7 changes: 7 additions & 0 deletions workspaces/circular-sequence/src-rust/sequence_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ impl SequenceStore {
self.sequences.get(index as usize)
}

pub fn get_index(&self, sequence: &Sequence) -> Option<u8> {
match self.get_match(sequence) {
Match::Exact(index) => Some(index),
_ => None,
}
}

pub fn get_match(&self, sequence: &Sequence) -> Match {
get_match(sequence, &self.sequences)
}
Expand Down
Binary file added workspaces/common/.DS_Store
Binary file not shown.
7 changes: 4 additions & 3 deletions workspaces/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"type": "module",
"main": "./src/index.ts",
"dependencies": {
"framer-motion": "^10.16.16",
"lucide-react": "^0.294.0",
"preshape": "^19.1.0",
"framer-motion": "11.5.6",
"lucide-react": "0.445.0",
"luxon": "3.5.0",
"preshape": "^19.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.20.1",
Expand Down
4 changes: 1 addition & 3 deletions workspaces/common/src/Article/ArticleFigCodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function ArticleFigCodeBlock({
borderSize="x1"
flex="vertical"
grow
padding="x6"
minWidth="0px"
>
{presentation}
Expand All @@ -69,13 +70,10 @@ export default function ArticleFigCodeBlock({
<Text basis="0" flex="horizontal" grow minWidth={0} size="x3">
<Motion
basis="0"
// animate={{ height: isExpanded ? 'auto' : '300px' }}
// initial={{ height: '300px' }}
flex="vertical"
grow
overflow="auto"
ref={refCodeBlock}
// maxHeight="300px"
>
<CodeBlock grow language={language} padding="x6">
{contents}
Expand Down
14 changes: 11 additions & 3 deletions workspaces/common/src/ProjectPage/ProjectPageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Box, BoxProps, Text } from 'preshape';
import { formateDate } from '../utils';
import { useProjectPageContext } from './useProjectPageContext';

export default function ProjectPageHeader(props: BoxProps) {
const { name, description, wip } = useProjectPageContext();
const { name, description, created, updated, wip } = useProjectPageContext();
const createdString = formateDate(created);
const updatedString = formateDate(updated);
const showUpdated = createdString !== updatedString;

return (
<Box {...props}>
Expand All @@ -14,7 +18,7 @@ export default function ProjectPageHeader(props: BoxProps) {
{description}
</Text>

{wip && (
{wip ? (
<Text
backgroundColor="accent-shade-1"
borderRadius="x1"
Expand All @@ -25,7 +29,11 @@ export default function ProjectPageHeader(props: BoxProps) {
size="x3"
weight="x3"
>
WIP
Work In Progress
</Text>
) : (
<Text size="x3" weight="x2">
Written {createdString} {showUpdated && `· Updated ${updatedString}`}
</Text>
)}
</Box>
Expand Down
15 changes: 15 additions & 0 deletions workspaces/common/src/ProjectWindow/ProjectHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Box, BoxProps } from 'preshape';

export default function ProjectHeader(props: BoxProps) {
return (
<Box
alignChildrenHorizontal="between"
{...props}
alignChildrenVertical="middle"
flex="horizontal"
gap="x4"
padding="x4"
paddingVertical="x2"
/>
);
}
5 changes: 5 additions & 0 deletions workspaces/common/src/ProjectWindow/ProjectHeaderGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Box, BoxProps } from 'preshape';

export default function ProjectHeaderGroup(props: BoxProps) {
return <Box {...props} />;
}
Loading

0 comments on commit 327d1b5

Please sign in to comment.