Export Points from object into txt file
 1-20  21-40

Previous
Next
 From:  pior (PIOR_O)
9071.21 In reply to 9071.20 
Hello Michael, thank you for the support as always.

FWIW here is what I am getting when running SavePointFile (most updated version) on 4 points which have been copied from a square shape, drawn in top view (first screenshot). It looks like the line breaks have been ignored altogether somehow ? Whereas the OBJ data for the same shape planar filled before obj export is organized more as expected (second screenshot). I'm on Windows btw.

EDITED: 14 Sep 2021 by PIOR_O

Image Attachments:
Size: 16.1 KB, Downloaded: 45 times, Dimensions: 557x259px
Size: 45.5 KB, Downloaded: 30 times, Dimensions: 859x406px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.22 In reply to 9071.21 
Hi pior, if you're using Windows notepad the problem is that it doesn't recognize unix-style newline only line endings.

Try with a more fully functional text editor like notepad++.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.23 In reply to 9071.22 
I see - and I had the answer right there in front of me as it was just a matter of opening that txt in Sublime just like I did with the OBJ. And indeed opening the .txt in it does recognize the lines/structure.

Interestingly enough opening the .txt in some programs that respect the CSV structure and resaving from there seems to generate a .txt that has lines in notepad while still being a clean CSV. So perhaps it could be possible to write out a structure that does both ? But of course not at the cost of doubling the line breaks.

On a related topic : is there a feature in MOI that would convert shapes (with lines, polylines and curves) to segmented shapes, similarly to what the DXF exporter does to shapes and the OBJ exporter does to filled shapes ? The point (!) being to have points that can still describe the curved elements accurately, without resampling the straight lines. A "convert to polygon" feature of sorts :


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.24 In reply to 9071.23 
Hi pior,

re:
> So perhaps it could be possible to write out a structure that does both ?

Currently there isn't any way to adjust the line endings in MoI's text file output to MS-DOS style but it would not be hard to add in an option for that in the future once v5 betas are underway. For now to get that you would need to open and resave it in a text editor that allows you to control the line endings.

re:
> On a related topic : is there a feature in MOI that would convert shapes (with lines, polylines and curves)
> to segmented shapes, similarly to what the DXF exporter does to shapes and the OBJ exporter does to
> filled shapes ?

You could use the DXF exporter for this purpose, save out to DXF format, with Export type = "3D Curves", and Write curves as "Polylines". Then read the DXF file back into MoI. That should convert curves into segmented lines.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.25 In reply to 9071.24 
All noted - and indeed, the DXF route sounds rock solid. Thanks again !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.26 In reply to 9071.25 
By the way, I have another question related to this topic of writing out points data.

Is there any way to control, or at least visualize, the ordering of the points within a shape object ? By that I mean being able to see which point is first and which is last, and flipping this around if needed.
Or, if not possible, is there some clever workaround to force the ordering one way or another ? Like for instance fusing curves in a given order, forcing a recalculation with a trim, and so on.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.27 In reply to 9071.26 
Hi pior, try this plugin here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9781.5

That will let you visualize and adjust the direction of curves. Let me know if that wasn't what you were asking about.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.28 In reply to 9071.27 
Hello Michael,

Well, that seems to be exactly it, thanks ! And I assume the little dot represents the start point on closed curves, which in turn allows me to reassign it another point by making a small gap in the shape where I want the starting to be, and then close the gap again.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.29 In reply to 9071.28 
Hi pior, for changing the start/end "seam" point on a closed curve try this one:
http://moi3d.com/forum/index.php?webtag=MOI&msg=10125.8

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.30 In reply to 9071.29 
Well, that's exactly it :) Thanks !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.31 

Hello again - I actually have another question about this topic.

While I am going through this workflow with more complicated objects/drawings, I find that the SavePointFile command, while being functional, is a bit cumbersome in how it expects a pure selection of point objects. By that I mean that in order to get to these points, I first have to display all the points of a given object or objects, then select them manually (carefully avoiding selecting full curves, which can be near impossible), ctrl-c them, get out of the points display mode, delete the source curve objects, then paste the points. And from there, SavePointFile can then be run on a selection of points.

Is there any clever way to bypass all that by somehow converting any (segmented) curve object to its points only, without any manual selection needed ?
And on a similar topic, is there any way to run ArrayCurve (with a single point as input) on multiple curves at once ?

I hope this makes sense - I'll provide diagrams if that is unclear.

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.32 In reply to 9071.31 
Hi pior,

re:
> Is there any clever way to bypass all that by somehow converting any (segmented) curve
> object to its points only, without any manual selection needed ?

It should be possible to make a script that will do this. But can you clarify what type of points you want, do you want points that are equally spaced on the curve, or do you want the control points of the curve as would be displayed by Edit > Show pts?

> And on a similar topic, is there any way to run ArrayCurve (with a single point as input) on multiple curves at once ?

Not currently but it could be possible to make a script for this as well. But again I would need some clarification, do you want the same point to be used for all the curves even though the point would not be directly on some of them or do you want a separate point for each curve to be created with it located at the start of each curve?

it would be helpful to see some example inputs and the desired outputs to make sure I can get it to behave as you need.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.33 In reply to 9071.32 
Hello ! Absolutely, here is more context :

https://www.youtube.com/watch?v=4Mtun8PgbfQ

On this example I am working with a bunch of curve objects (a total of 10) that will be exported to points data using SavePointFile as per the topic of this thread. It is a trivial thing to do when dealing with only a single curve object, but the selection process becomes quite tedious when working with multiple - as one often ends up selecting full curves, which in turn leads to a selection buffer than does not get converted to standalone points. You'll see me fight against that in the clip.

So from there I was wondering if there was any way to automate this conversion process - that is to say, running some sort of "extract points" command, operating on multiple objects at once.

(CurveArray can be a good workaround at times but in my case here it is not practical as the curve objects are already optimized and are crafted with as few points as possible).

I hope this makes more sense !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.34 In reply to 9071.33 
Hi pior, are the curves you show there all polylines where they're all made up of line segments? And the points you want are the points of the polyline, not any more added to the interior of any curve segments?

> So from there I was wondering if there was any way to automate this conversion process -
> that is to say, running some sort of "extract points" command, operating on multiple
> objects at once.

Yes it should be possible but it would help if you could post an example .3dm file that has an example of an input and expected output for the "extract points" mechanism that you need.

That would help me to know what kind of points you want to be created.

There are many potential ways, like do you need points evenly spaced by distance across the curves? Points at just the ends of segments? Points along a bendy curve by some angle metric? The control point hull of the a bendy curve? ... ?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.35 In reply to 9071.34 
Hello -

Yes the input objets are as "raw" as possible in my case, all made of connected straight segments (as per processed once by a DXF export, or as drawn manually point by point). And then the goal would be to get the points copied out of these objects, ready for SavePointFile.

I personally have no need for bezier control points in this process, and no need for any resampling of points either as the points have all been manually placed for the objects to be as clean and lightweight as possible.

Here is a file with a before/after :

https://drive.google.com/file/d/1WKKFvrZKFJr3GZavhIFN9Mgzad3E-yN9/view?usp=sharing



I hope this makes sense !

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.36 In reply to 9071.35 
Thanks pior, please try the attached command. Select your polylines and then run ExtractPolylinePoints and it should generate those points and select them so they are ready to be exported.

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
9071.37 In reply to 9071.36 
Points will be exported at what format ?
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9071.38 
Hello Michael - that's excellent ! This is working perfectly, and saves quite a bit of time and error. Loving how the selection is automatically ready to go. Thank you so much, as always.

@FP : the export format discussed in this thread is simply .txt, formatted as what is called "CSV" (comma separated values). This is a very simple database format that is very useful for all kinds of applications. For instance online bank accounts can be downloaded as such and then manipulated with spreadsheet software, data processing/visualisation applications, and so on.

In the case of the SavePointFile from this thread the export is simply XX,YY,ZZ on each line like so :



And from there one can do all kinds of stuff with the data. In my case I am converting it to a series of segment lengths and angles fed it into a drawing robot. This allows me to speed up the drafting of full scale sewing patterns.

https://www.youtube.com/watch?v=yobpxLgDAr4

So again a huge thanks to Michael (and the person originally asking the question about exporting points to CSV) as the information and help in this thread was exactly what I needed. Being able to export the data directly from MOI is truly excellent.

EDITED: 24 Sep 2021 by PIOR_O


Image Attachments:
Size: 670 KB, Downloaded: 41 times, Dimensions: 954x531px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9071.39 In reply to 9071.38 
You're welcome pior, I'm glad that will be useful! That's a cool project with a real life Logo/turtle drawing robot set up!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Frenchy Pilou (PILOU)
9071.40 In reply to 9071.38 
Thx for the infos and bravo for the robot!
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-20  21-40