joint icon indicating copy to clipboard operation
joint copied to clipboard

Vectorizer: can not convert zero-length arc to curve

Open kumilingus opened this issue 1 year ago • 0 comments

Discussed in https://github.com/clientIO/joint/discussions/2464

Originally posted by gordon-brown January 3, 2024

Introduction

I'm having an issue rendering one of the clip art shapes I converted. It seems to me to be related to rendering elliptical curves in the path data. I can render the shape on the https://www.svgviewer.dev/ site. Not sure if I am doing something wrong or if this is an issue with your software. BPMN_StoredData-202401030954.joint.txt Screenshot 2024-01-03 100103 Screenshot 2024-01-03 100348

Steps to reproduce

No response

Restrictions & Constraints

No response

Does your question relate to JointJS or JointJS+. Select both if applicable.

JointJS


There seems to be an issue with an arc command that has zero length and our code is not able to convert it to the curve command. I am changing the question to a bug.

It works if you define your path like this: 'M 5.555555555555555 0L 50 0A 5.555555555555555,25 0 0,0 50,50 L 50,50L 5.555555555555555 50A 5.555555555555555,25 0 0,1 5.555555555555555,0Z'

From Artur

Visio implications

Also, this is happening when importing joint-format-visio\test\visual\fixtures\Chapter05\Network diagram_start.vsdx. Path

M 0 0 M 32 4 A 3.95 3.95 0 0 1 24.49 3.95 A 3.95 3.95 0 0 1 32.39 3.95 A 3.95 3.95 0 0 1 32.39 3.95

normalized using V.normalizePathData with NaNs as

M 0 0 M 32 4 C 31.03738563658328 6.884319592775694 27.313384109109503 7.644958723402278 25.296797250840925 5.369150434247764 C 24.931981254846672 4.957439297533957 24.65718116651638 4.474067961804264 24.49 3.95 C 24.49 0.9092885822679708 27.781666666666666 -0.9911560538145481 30.415 0.5291996550514662 C 31.637134253196088 1.2347991951200896 32.39 2.5388009198627532 32.39 3.95 C NaN NaN NaN NaN 32.39 3.95

kumilingus avatar Jan 03 '24 15:01 kumilingus