fix: update distance text calculation to include cone height in MeasurementTool

This commit is contained in:
Jerald-Golden-B 2025-05-22 16:37:02 +05:30
parent 73bb37e083
commit c2d952c190
3 changed files with 6 additions and 21 deletions

View File

@ -10,7 +10,7 @@ function updateDistanceText(
////////// Updating the Distance Texts of the lines that are affected during drag //////////
const DistanceGroup = scene.children.find((child) => child.name === "Distance_Text") as THREE.Group;
const DistanceGroup = scene.getObjectByName('Distance_Text') as THREE.Group;
affectedLines.forEach((lineIndex) => {
const mesh = floorPlanGroupLine.current.children[lineIndex] as THREE.Mesh;

View File

@ -10,7 +10,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
const [selectedComment, setSelectedComment] = useState<CommentSchema | null>(null);
const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null);
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
const keyCombination = detectModifierKeys(e);
@ -43,20 +42,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
className='comments-main-wrapper'
>
<CommentThreads />
{/* <div
className='outer'
onClick={(e) => {
e.stopPropagation();
setSelectedComment(comment);
console.log("down");
}}
onPointerOver={(e) => {
e.stopPropagation();
}}>
<div>
hii
</div>
</div> */}
</Html>
{CommentRef.current && transformMode && (
<TransformControls

View File

@ -218,7 +218,7 @@ const MeasurementTool = () => {
sprite
>
<div>
{startConePosition.distanceTo(endConePosition).toFixed(2)} m
{(startConePosition.distanceTo(endConePosition) + (coneSize.height)).toFixed(2)} m
</div>
</Html>
)}