SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

Future Request: "Import curve coordinates (2D)" (by User1)
This future very usefull when need use standart metal rolling profiles, airfoils from NACA catalogs,
Idea: make import CSV for coordinates of curve (or lines).

How it must work: when you stay in "sketch-in-plane" mode and import "sample.csv" it will create Curve, where every string in CSV will converted to SLVS entity.

* In .CSV
...
2.0064 -3.2400
...

* In .SLVS
...
Entity.actPoint.x=2.0064
Entity.actPoint.y=-3.2400
...
Wed Dec 9 2015, 16:48:52
Modifying input files (by Chinmay)
Someone had suggested a work-around earlier and it might work for you.

Instead of having Solvespace import curves, one could modify the solvespace input .slvs file manually or using a script. You can modify the text file to add a bunch of curves with the intended points.

In doing so, I wasn't quite sure how the Entity.h.v, Entity.type, and other properties associated with a point should be handled.

Also, the location of the points need to be added as Params, it seems. An example is below.

Param.h.v.=00040010
Param.val=-29.33984375000000000000
AddParam

Param.h.v.=00040011
Param.val=11.10781249999999964473
AddParam

Param.h.v.=00040013
Param.val=28.13593749999999715783
AddParam

Param.h.v.=00040014
Param.val=28.12421874999999715783
AddParam

This seems to define a line segment:

Entity.h.v=00040000
Entity.type=11000
Entity.construction=0
Entity.point[0].v=00040001
Entity.point[1].v=00040002
Entity.workplane.v=80020000
Entity.actVisible=1
AddEntity

This chunk seems to define the points:

Entity.h.v=00040001 <---- seems like an ID you can increment by 1
Entity.type=2001 <--- seems like a specific number in the code
Entity.construction=0
Entity.workplane.v=80020000
Entity.actPoint.x=-29.33984375000000000000
Entity.actPoint.y=11.10781249999999964473
Entity.actVisible=1
AddEntity

Entity.h.v=00040002
Entity.type=2001
Entity.construction=0
Entity.workplane.v=80020000
Entity.actPoint.x=28.13593749999999715783
Entity.actPoint.y=28.12421874999999715783
Entity.actVisible=1
AddEntity

So, it's not just Entity.actPoint, but a few other places to make it consistent. I haven't figured it out yet. Otherwise, automatically generating an SLVS input file from airfoil data should be possible.

It would help if someone posts an example blurb of an slvs file that adds a point with some guidance as to how to connect the various Entities to create a line segment or polyline.

As always, a big thanks for this excellent piece of software.
Fri Dec 11 2015, 13:45:44
(no subject) (by Jonathan Westhues)
Chinmay's post is basically correct. There's no explicit documentation for the .slvs file format. DOC.txt for the library is probably your best reference there, since the entities and parameters exposed in that interface correspond very closely to the internal structures.

Entities are exported in the .slvs file only for the benefit of assemblies, which load those cached entities to avoid the need to regenerate each imported part. That's what Entity.actPoint is for; it has no effect when a sketch is opened directly.

When a sketch is opened directly, only the requests and parameters matter. The request generates the entities, and the parameters set the initial position (before constraints are solved, if applicable) of the points etc. that define the entities.

For the specific application here, I might suggest that you set a bitmap image of the airfoil as your background (under "line styles" from the home screen), and then trace it with a spline. That's ugly, but the result is a real smooth curve with few control points, maybe better than piecewise linear.
Sat Dec 12 2015, 17:28:31
(no subject) (by whitequark)
We are planning to add a Python interface in near future for exactly this kind of application. There are some annoying infrastructure problems to solve beforehand, I think you can expect this by the end of January.
Fri Dec 25 2015, 06:04:29
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.