Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to flatten a 3D Curve object into 2D

Please login with a confirmed email address before reporting spam

Sorry if this is an obvious question.

I've isolated a curve out of a complex 3D geometry. I want to flatten this curve in 2D, allowing me to generate a 2D geometry that I can use to create something I later extrude back into 3D.

I have the design module, I do not (right now) have access to CAD support or software. Is this something I can do? Right now the best I can do is try and match the curve with a bezier polygon, which is slow and inaccurate.


4 Replies Last Post 29.05.2019, 03:24 GMT-4
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 28.05.2019, 04:45 GMT-4
Updated: 5 years ago 28.05.2019, 06:04 GMT-4

I don't know of any automated way to do this.

You can create a model method or use LiveLink for Matlab to

  • Extract the coordinates of a curve (edge).
  • Flatten the coordinates (I guess this means project these coordinates to a plane).
  • Using these coordinates you can create a new interpolation curve that you can insert into your geometry (e.g. on a workplane).
-------------------
Lars Gregersen
Comsol Denmark
I don't know of any automated way to do this. You can create a model method or use LiveLink for Matlab to * Extract the coordinates of a curve (edge). * Flatten the coordinates (I guess this means project these coordinates to a plane). * Using these coordinates you can create a new interpolation curve that you can insert into your geometry (e.g. on a workplane).

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 28.05.2019, 05:52 GMT-4

Thank you Lars, I'll give that a go and let you know how it went.

Thank you Lars, I'll give that a go and let you know how it went.

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 28.05.2019, 07:25 GMT-4
Updated: 5 years ago 28.05.2019, 07:52 GMT-4

It worked well, thank you.

I used the measure tool on individual points to get coordinates in the message box, copied the message box into excel, used the "text to columns" data tool in excel to automatically split off the coordinates I wanted from extraneous text, then copied them back into an interpolation curve table.

It worked well, thank you. I used the measure tool on individual points to get coordinates in the message box, copied the message box into excel, used the "text to columns" data tool in excel to automatically split off the coordinates I wanted from extraneous text, then copied them back into an interpolation curve table.

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 29.05.2019, 03:24 GMT-4

Hi Martin

I'm glad that it worked. I prefer programming to solve problems like this, but whatever gets the problem solved is fine.

A faster, manual process would be to mesh the curve you wish to export (just the edge, nothing else). You can then export the edge elements to a mphtxt-file. If you open that file you'll find all the coordinates of the mesh, which you can copy to Excel. Note that coordinates may be output of order using this method.

-------------------
Lars Gregersen
Comsol Denmark
Hi Martin I'm glad that it worked. I prefer programming to solve problems like this, but whatever gets the problem solved is fine. A faster, manual process would be to mesh the curve you wish to export (just the edge, nothing else). You can then export the edge elements to a mphtxt-file. If you open that file you'll find all the coordinates of the mesh, which you can copy to Excel. Note that coordinates may be output of order using this method.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.