Skip to content

Commit c4f41c3

Browse files
apply coderabbit suggestions
1 parent f897b89 commit c4f41c3

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

frontend/javascripts/viewer/model/sagas/meshes/ad_hoc_mesh_saga.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import type { Saga } from "viewer/model/sagas/effect-generators";
4747
import { select } from "viewer/model/sagas/effect-generators";
4848
import { Model } from "viewer/singletons";
4949
import Store from "viewer/store";
50-
import { stlMeshConstants } from "viewer/view/right-border-tabs/segments_tab/segments_view";
5150
import { getAdditionalCoordinatesAsString } from "../../accessors/flycam_accessor";
5251
import { ensureSceneControllerReady, ensureWkReady } from "../ready_sagas";
5352

@@ -70,13 +69,6 @@ function marchingCubeSizeInTargetMag(): Vector3 {
7069
return WkDevFlags.meshing.marchingCubeSizeInTargetMag;
7170
}
7271
const modifiedCells: Set<number> = new Set();
73-
export function isMeshSTL(buffer: ArrayBuffer): boolean {
74-
const dataView = new DataView(buffer);
75-
const isMesh = stlMeshConstants.meshMarker.every(
76-
(marker, index) => dataView.getUint8(index) === marker,
77-
);
78-
return isMesh;
79-
}
8072

8173
function getOrAddMapForSegment(
8274
layerName: string,
@@ -554,12 +546,17 @@ function* refreshMeshes(): Saga<void> {
554546
continue;
555547
}
556548

549+
const meshInfo = yield* select((state) =>
550+
getMeshInfoForSegment(state, additionalCoordinates, segmentationLayer.name, segmentId),
551+
);
552+
557553
yield* call(
558554
refreshMeshWithMap,
559555
segmentId,
560556
threeDMap,
561557
segmentationLayer.name,
562558
additionalCoordinates,
559+
meshInfo?.opacity || Constants.DEFAULT_MESH_OPACITY,
563560
);
564561
}
565562
}

0 commit comments

Comments
 (0)