|
|
@@ -1544,7 +1544,8 @@ export default class DARAMeasurementTool extends AnnotationTool {
|
|
|
const rightPerpConfig = { ...DEFAULT_RIGHT_PERPENDICULAR };
|
|
|
|
|
|
const perpendicularLengthD = rightPerpConfig.length;
|
|
|
- const perpendicularEndD = vectorAdd(intersectionD, decomposeVectorOnAxes(cachedStats.perpendicularVector, perpendicularLengthD));
|
|
|
+ // 反转垂线向量方向,确保与右侧髋臼切线起点和终点在同一侧
|
|
|
+ const perpendicularEndD = vectorAdd(intersectionD, decomposeVectorOnAxes(vectorScale(cachedStats.perpendicularVector, -1), perpendicularLengthD));
|
|
|
const perpendicularEndDCanvas = viewport.worldToCanvas(perpendicularEndD);
|
|
|
const perpendicularLineDUID = `${annotationUID}-perpendicular-right`;
|
|
|
const perpendicularLineDOptions = {
|
|
|
@@ -1563,12 +1564,13 @@ export default class DARAMeasurementTool extends AnnotationTool {
|
|
|
);
|
|
|
|
|
|
// 绘制角度弧线(垂线与右髋臼切线之间的夹角)
|
|
|
- // 将3D向量转换为2D向量用于绘制
|
|
|
- const perpendicularVector2D: CoreTypes.Point2 = [cachedStats.perpendicularVector[0], cachedStats.perpendicularVector[1]];
|
|
|
- let rightTangentVector2D: CoreTypes.Point2 = [cachedStats.rightTangentVector[0], cachedStats.rightTangentVector[1]];
|
|
|
- //如果钝角,使用反向向量,为了画锐角的弧线
|
|
|
+ // 将3D向量转换为2D向量用于绘制,反转垂线向量以匹配右侧方向
|
|
|
+ const perpendicularVector2D: CoreTypes.Point2 = [-cachedStats.perpendicularVector[0], -cachedStats.perpendicularVector[1]];
|
|
|
+ // 调整切线向量以确保弧线绘制在锐角侧
|
|
|
+ let rightTangentVector2D: CoreTypes.Point2 = [-cachedStats.rightTangentVector[0], -cachedStats.rightTangentVector[1]];
|
|
|
+ // 如果钝角,使用原向向量;如果是锐角,使用反向向量
|
|
|
if (cachedStats.angleRightOrigin > 90) {
|
|
|
- rightTangentVector2D = [-cachedStats.rightTangentVector[0], -cachedStats.rightTangentVector[1]];
|
|
|
+ rightTangentVector2D = [cachedStats.rightTangentVector[0], cachedStats.rightTangentVector[1]];
|
|
|
}
|
|
|
// 创建弧线点数组
|
|
|
const arcRadiusD = 30; // 弧线半径
|