fix(viewer-lib): Circles now have a fixed sample point count for simplicity. In relative terms, when viewing the circle at normal zoom levels you will get good visual fidelity. (#5199)

This commit is contained in:
Alexandru Popovici
2025-08-08 16:16:21 +03:00
committed by GitHub
parent 5d3f47a06b
commit cd9fc24148
2 changed files with 10 additions and 8 deletions
+5
View File
@@ -624,6 +624,11 @@ const getStream = () => {
// Text with color proxy
// 'https://app.speckle.systems/projects/ebf93a561b/models/0a07bc3231'
// 'https://latest.speckle.systems/projects/9f13b874cf/models/0575b5dcd2'
// Circles of different sizes
// 'https://latest.speckle.systems/projects/4658eb53b9/models/bb726a3764'
)
}
@@ -683,13 +683,9 @@ export class SpeckleGeometryConverter extends GeometryConverter {
*/
protected CircleToGeometryData(node: NodeData): GeometryData | null {
const conversionFactor = getConversionFactor(node.raw.units)
const curveSegmentLength = 0.1 * conversionFactor
const points = this.getCircularCurvePoints(
node.raw.plane,
node.raw.radius * conversionFactor,
undefined,
undefined,
curveSegmentLength
node.raw.radius * conversionFactor
)
return {
attributes: {
@@ -891,7 +887,7 @@ export class SpeckleGeometryConverter extends GeometryConverter {
radius: number,
startAngle = 0,
endAngle = 2 * Math.PI,
res = 0.1
resolution = 128
) {
// Get alignment vectors
const center = this.PointToVector3(plane.origin)
@@ -903,8 +899,9 @@ export class SpeckleGeometryConverter extends GeometryConverter {
yAxis.normalize()
// Determine resolution
let resolution = ((endAngle - startAngle) * radius) / res
resolution = parseInt(resolution.toString())
/** Alex 07.08.2025: This can blowup for very large circles, so we use a fixed number of sample points */
// let resolution = ((endAngle - startAngle) * radius) / res
// resolution = parseInt(resolution.toString())
const points = []