Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
fbe7bce
Cones: skip seam vertices, close corner roundoff, paint floors in layers
SunkenInTime Oct 3, 2026
179b605
Keep floor footprints as rings so a worker can build floor layers
SunkenInTime Oct 3, 2026
31a323c
Review fixes: seams need walls on both sides, slack scales with distance
SunkenInTime Oct 3, 2026
5ed768d
Seams only where a wall's side is certain; add floors instead of masking
SunkenInTime Oct 3, 2026
3729ad1
Cast cones against merged outlines when the model carries them
SunkenInTime Oct 3, 2026
795b9c9
Build floor shadows three times faster, without the faces that add no…
SunkenInTime Oct 3, 2026
a29e175
Let runtime walls carry a piece's own edges under its heights
SunkenInTime Oct 3, 2026
1b08ca8
Fix the runtime-edges test name
SunkenInTime Oct 3, 2026
871de7b
Type the runtime-walls test list for added entries
SunkenInTime Oct 3, 2026
ef19055
Keep the refused-merge test off the shared pieces
SunkenInTime Oct 3, 2026
705d017
Tell a wall's side once per run of its ring, unknown where edges meet
SunkenInTime Oct 3, 2026
e4c8d93
Run a cone query's threads above normal priority on Windows
SunkenInTime Oct 3, 2026
830a965
Cast no side rays at a vertex the wall runs straight across
SunkenInTime Oct 3, 2026
167353e
Pin the rays past a curved wall's silhouette
SunkenInTime Oct 3, 2026
5c2fb78
Place a nudged cone where the walls are, not where the agent's cone s…
SunkenInTime Oct 4, 2026
a7ac032
Merge remote-tracking branch 'origin/main' into t3code/cone-runtime
SunkenInTime Oct 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
451 changes: 397 additions & 54 deletions lib/view_cone/svg_floor_visibility.dart

Large diffs are not rendered by default.

27 changes: 26 additions & 1 deletion lib/view_cone/svg_height_native_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ typedef _QueryD = int Function(Pointer<Void>, double, double, double, double,
double, int, Pointer<Uint8>, int, Pointer<SvgHeightNativeResult>);
typedef _ErrorC = Int32 Function(Pointer<Void>, Pointer<Utf8>, Uint32);
typedef _ErrorD = int Function(Pointer<Void>, Pointer<Utf8>, int);
typedef _SidesC = Int32 Function(Pointer<Void>, Pointer<Uint8>, Uint32);
typedef _SidesD = int Function(Pointer<Void>, Pointer<Uint8>, int);
typedef _CloseC = Int32 Function(Pointer<Void>);
typedef _CloseD = int Function(Pointer<Void>);
typedef _FinalizeC = Void Function(Pointer<Void>);
Expand Down Expand Up @@ -117,13 +119,18 @@ class SvgHeightNative implements Finalizable {

static const int _maximumPointCount = 1 << 22;

/// [interiorSides], one byte per edge, says which side of it its own wall
/// lies on (0 right, 1 left, 2 unknown); with it the query skips seams
/// between touching pieces.
factory SvgHeightNative.open({
required List<String> wallIds,
required Float64List edgeRecords,
Uint8List? interiorSides,
String? libraryPath,
}) {
final edgeCount = edgeRecords.length ~/ 5;
if (edgeRecords.length % 5 != 0 ||
(interiorSides != null && interiorSides.length != edgeCount) ||
wallIds.length > 1 << 20 ||
edgeCount > 1 << 19) {
throw ArgumentError('SVG native geometry exceeds its bounded capacity.');
Expand Down Expand Up @@ -153,6 +160,8 @@ class SvgHeightNative implements Finalizable {
final readError =
library.lookupFunction<_ErrorC, _ErrorD>('ish_last_error');
final close = library.lookupFunction<_CloseC, _CloseD>('ish_close');
final setSides =
library.lookupFunction<_SidesC, _SidesD>('ish_set_interior_sides');
final maskBuffer = library
.lookupFunction<_MaskBufferC, _MaskBufferD>('ish_active_wall_buffer');
final resultBuffer = library
Expand All @@ -174,6 +183,18 @@ class SvgHeightNative implements Finalizable {
close(handle);
throw StateError('SVG native context has no query buffers.');
}
if (interiorSides != null && interiorSides.isNotEmpty) {
final sides = calloc<Uint8>(interiorSides.length);
try {
sides.asTypedList(interiorSides.length).setAll(0, interiorSides);
if (setSides(handle, sides, interiorSides.length) != 0) {
close(handle);
throw StateError('SVG native context refused the wall sides.');
}
} finally {
calloc.free(sides);
}
}
return SvgHeightNative._(
ids, handle, mask, result, query, readError, close, finalizer);
} finally {
Expand All @@ -187,13 +208,17 @@ class SvgHeightNative implements Finalizable {
static SvgHeightNative? tryOpen({
required List<String> wallIds,
required Float64List edgeRecords,
Uint8List? interiorSides,
String? libraryPath,
}) {
// Validate through the public constructor. DynamicLibrary.open and symbol
// lookup both report unavailable native code as ArgumentError.
try {
return SvgHeightNative.open(
wallIds: wallIds, edgeRecords: edgeRecords, libraryPath: libraryPath);
wallIds: wallIds,
edgeRecords: edgeRecords,
interiorSides: interiorSides,
libraryPath: libraryPath);
} on UnsupportedError {
return null;
} on ArgumentError catch (error) {
Expand Down
2 changes: 2 additions & 0 deletions lib/view_cone/svg_height_native_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ class SvgHeightNative {
factory SvgHeightNative.open(
{required List<String> wallIds,
required Float64List edgeRecords,
Uint8List? interiorSides,
String? libraryPath}) =>
throw UnsupportedError('Native acceleration is unavailable on web.');
static SvgHeightNative? tryOpen(
{required List<String> wallIds,
required Float64List edgeRecords,
Uint8List? interiorSides,
String? libraryPath}) =>
null;
SvgHeightNativeCone query(
Expand Down
Loading
Loading