Deviation in the cube when draw data points

I am drawing points data to Cesium. I’m using proj4 to convert points from EPSG:2452 to EPSG:4326.
Then I using Rectangle.fromCartesianArray() to draw.
but there was a deviation in the cube when drawing:

I tried to fix it, but it didn’t work.

Here is my current code:

const meshSize = 1;
const pointConvert = proj4(“EPSG:2452”, “EPSG:4326”, [
point.x,
point.y,
point.heightDiff,
]);
const pointConvert2 = proj4(“EPSG:2452”, “EPSG:4326”, [
point.x + meshSize,
point.y + meshSize,
]);

const tl = Cartographic.fromDegrees(pointConvert[0], pointConvert[1], 0);
const tr = Cartographic.fromDegrees(pointConvert[0], pointConvert2[1], 0);
const bl = Cartographic.fromDegrees(pointConvert2[0], pointConvert[1], 0);
const br = Cartographic.fromDegrees(pointConvert2[0], pointConvert2[1], 0);
const tl1 = Cartographic.toCartesian(tl);
const tr1 = Cartographic.toCartesian(tr);
const bl1 = Cartographic.toCartesian(bl);
const br1 = Cartographic.toCartesian(br);
const cartographicArr = [bl1, br1, tr1, tl1];

const color = pointConvert[2] > heightColor ? 0 : 255 - pointConvert[2] / heightColor * 255;
viewer?.entities.add({
rectangle: {
coordinates: Rectangle.fromCartesianArray(cartographicArr),
outline: true,
material: Color.fromBytes(255, color, color),
height: point.cadHeight + offsetHeight,
extrudedHeight: point.cadHeight + pointConvert[2] + offsetHeight,
},
});

Can anyone help me here? :slight_smile:

I don’t know why, but it only happen in Mac OS
In Window, the cube is not deviate