Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To convert the AutoCAD's Spline into a piece of tinyspline #187

Closed
my88480 opened this issue Nov 20, 2021 · 4 comments
Closed

To convert the AutoCAD's Spline into a piece of tinyspline #187

my88480 opened this issue Nov 20, 2021 · 4 comments

Comments

@my88480
Copy link

my88480 commented Nov 20, 2021

There are many ways to import AutoCAD's spline, such as reading from memoryStream, importing from dwg/dxf.

We just need to focus on the defination of AutoCAD's spline:

0
SPLINE
5
308
330
1F
100
AcDbEntity
8
0
100
AcDbSpline
210
0.0
220
0.0
230
1.0
70
1064
71
3
72
13
73
9
74
7
42
0.000000001
43
0.0000000001
44
0.0000000001
40
0.0
40
0.0
40
0.0
40
0.0
40
390.5493975743106
40
677.2206757692665
40
1002.846191932886
40
1291.989729074079
40
1778.088340446106
40
2303.88494716036
40
2303.88494716036
40
2303.88494716036
40
2303.88494716036
10
120.5630166126066
20
684.6051593101001
30
0.0
10
136.6059891205045
20
884.1624861126556
30
0.0
10
164.4248329098593
20
1230.198988924623
30
0.0
10
372.9331669533137
20
773.5459064677193
30
0.0
10
852.8280532028663
20
840.2592236363769
30
0.0
10
535.638524563657
20
1339.196096196008
30
0.0
10
1351.450244239125
20
1263.431997433616
30
0.0
10
1338.621034299898
20
885.8941891046457
30
0.0
10
1331.954775845166
20
689.7196297454939
30
0.0
11
120.5630166126066
21
684.6051593101001
31
0.0
11
206.2686033815262
21
1065.634533954959
31
0.0
11
408.3802574683796
21
862.3335230764933
31
0.0
11
730.7359317883383
21
908.3639044625742
31
0.0
11
691.0810658431146
21
1194.77528111753
31
0.0
11
1177.172950702195
21
1192.218045899848
31
0.0
11
1331.954775845166
21
689.7196297454939
31
0.0
0

We cound reshape the info ,then pass the parameters(control points,degree of spline etc) to tinyspline.

@msteinbeck
Copy link
Owner

I'm not sure what you are asking for in this issue. Do you request a function which allows you to import splines from dxf files (similar to ts_bspline_parse_json)?

@my88480
Copy link
Author

my88480 commented Nov 20, 2021

IC

New Spline:
Type:Spline
Flags:Rational
CreationMethod:FitPoints
Degree:3
StartTangent:
EndTangent:
KnotParameterization:FitChord
CtrlPointTolerance:1E-10
FitTolerance:1E-10
KnotTolerance:1E-09
IsClosed:KnotTolerance:False
IsPeriodic:False

Fit points:
Vector 0: 1.91678852581936, 2.99813041505149, 0
Vector 1: 87.6223752947389, 384.02750505991, 0
Vector 2: 289.734029381592, 180.726494181445, 0
Vector 3: 612.089703701551, 226.756875567526, 0
Vector 4: 572.434837756327, 513.168252222481, 0
Vector 5: 1058.52672261541, 510.611017004799, 0
Vector 6: 1213.30854775838, 8.11260085044523, 0

Control Points:
SplineVertex 0: 1.91678852581936, 2.99813041505149, 0
SplineVertex 1: 17.9597610337173, 202.555457217607, 0
SplineVertex 2: 45.7786048230721, 548.591960029574, 0
SplineVertex 3: 254.286938866526, 91.9388775726705, 0
SplineVertex 4: 734.181825116079, 158.652194741328, 0
SplineVertex 5: 416.99229647687, 657.589067300959, 0
SplineVertex 6: 1232.80401615234, 581.824968538567, 0
SplineVertex 7: 1219.97480621311, 204.287160209597, 0
SplineVertex 8: 1213.30854775838, 8.11260085044523, 0

Knots:
Knot 0: 0
Knot 1: 0
Knot 2: 0
Knot 3: 0
Knot 4: 390.549397574311
Knot 5: 677.220675769267
Knot 6: 1002.84619193289
Knot 7: 1291.98972907408
Knot 8: 1778.0883404461
Knot 9: 2303.88494716036
Knot 10: 2303.88494716036
Knot 11: 2303.88494716036
Knot 12: 2303.88494716036

image

@my88480 my88480 closed this as completed Nov 20, 2021
@msteinbeck
Copy link
Owner

So you were able to import the spline from AutoCAD to TinySpline on your own?

@my88480
Copy link
Author

my88480 commented Nov 24, 2021

It seems that I have imported the spline from AutoCAD to TinySpline.

But new problems come up.I would create a new issue.

thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants