#
luxiaotao1123
2024-08-20 9d71e24e7982f6915e5f832512925bee9b245f35
src/components/path.jsx
@@ -13,12 +13,10 @@
    REAL_COMPARE_MAP_OFFSET_Z,
} from '../config/setting'
const width = 20;
const getMajorPos = (position) => {
    return {
        x: position?.[2] * REAL_COMPARE_MAP_SCALE + REAL_COMPARE_MAP_OFFSET_X,
        y: position?.[1] * REAL_COMPARE_MAP_SCALE,
        y: position?.[1] * REAL_COMPARE_MAP_SCALE + 10,
        z: position?.[0] * REAL_COMPARE_MAP_SCALE + REAL_COMPARE_MAP_OFFSET_Z,
    }
}
@@ -44,23 +42,12 @@
    }, [points]);
    useEffect(() => {
        console.log(JSON.stringify(props.list));
        //[{"code":"00000052","position":[4961,0,2420],"serial":6},{"code":"00000053","position":[5491,0,2420],"serial":7},{"code":"00000054","position":[6021,0,2420],"serial":8}]
    }, [props])
    return (
        <>
            <group>
                {/* <mesh position={} rotation={[]}>
                    <planeGeometry
                        args={[width, height]}
                    ></planeGeometry>
                    <meshBasicMaterial color="rgb(23,146,247)"></meshBasicMaterial>
                </mesh> */}
                <line ref={lineRef}>
                    <bufferGeometry attach="geometry" />
                    <lineBasicMaterial attach="material" color="rgb(23,146,247)" linewidth={width} />
                    <lineBasicMaterial attach="material" color="rgb(23,146,247)" linewidth={50} />
                </line>
            </group>
        </>