Getting all points of a curve using a script
 1-7  8-27  28-42

Previous
Next
 From:  Lordfox
6257.28 In reply to 6257.27 
ok, commands folder, I did made in in the ui folder, ok, sorry ... but I was a long abstinent ;) and I use first time scripts in moi
  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:  Max Smirnov (SMIRNOV)
6257.29 In reply to 6257.21 
new version of the script.

EDITED: 7 Mar 2022 by SMIRNOV

  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:  bemfarmer
6257.30 In reply to 6257.29 
The zip file appears to be empty. ?
-Brian

EDITED: 15 Nov 2013 by BEMFARMER

  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:  Max Smirnov (SMIRNOV)
6257.31 In reply to 6257.30 
Brian, thank you. Reuploaded. :)
  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:  BurrMan
6257.32 In reply to 6257.31 
Max,
That is Banner! Thanks for taking the time to do that, and also share it....

I see you made a "copy to clipboard" for the labels which is very slick.....

I suppose there would need to be one more tweak to the labeling? I didn't think about how they would stack up on various curves/situations and MoI's texts are not "blocks", so they can become kindof unmanageable.

I was trying to imagine how that would/could be handled. It may get too complex/unwieldy to give each text block an "object name" of it's value, as it's created? Or it would have to be a vertically constrained list. The only real option would be to have them orient off the positions normal, and have a "distance away from point" value for closer sets, to remain separated.

It may just remain a great option for points that aren't too close....... It can provide some quick communication in the viewport.....

Anyway, thanks again. Nice.
  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)
6257.33 
Somptuous!

EDITED: 15 Nov 2013 by PILOU

  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:  Martin (MARTIN3D)
6257.34 In reply to 6257.29 
Max, thats it, thats exactly what I need. Especially the skip straight lines option is a huge timesaver. Great work! Thanks for sharing.
  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:  MajorGrubert (CARLOSFERREIRAPINTO)
6257.35 
Hi Max,

Thanks for the script. It will be a time saver for me.

Any chance of the new points made a new curve, above the reference curve and with an option (tick box) of deleting the reference curve?

Or placing the new points on the same curve and deleting the old ones.

Don't now if its possible, easy to do, or usefull for anybody else but me. Have a similar script on Illustrator.

The option 'skip straight lines' is fantastic.

Carlos
  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)
6257.36 In reply to 6257.35 
try this who connect some selected Points ;)
http://moi3d.com/forum/messages.php?webtag=MOI&msg=2749.56
---
Pilou
Is beautiful that please without concept!
My 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:  BurrMan
6257.37 In reply to 6257.35 
"""""""""Any chance of the new points made a new curve, above the reference curve and with an option (tick box) of deleting the reference curve?""""""""

I've fooled a bit with this to help with reverse engineering some things. I can test various tolerance inputs with this.

So if the script is not made more robust with these types of requests, here's an option for what you want.

You can use the script to generate the points you want, then use "SavePointFile" on those points. You can then "ImportPointFile" and choose the option to create a throughpoints curve from the import.

Anyway...... Thanks again to Max for sharing his scripting work.
  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:  MajorGrubert (CARLOSFERREIRAPINTO)
6257.38 
Hi BurrMan,

Make some attempts with your sugestions but couldn't get it to work. Will keep trying.

Anyway, thanks for your help.

Carlos
  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:  BurrMan
6257.39 In reply to 6257.38 
Hey Carlos,
Not sure whats happening for you. It could be the point structure is not good for a "full through points" import?

Here's a video of a workflow:



Notice I have to break out anywhere where the points are the "straight lines". The through points tool wont know how to do that.

So anyway, maybe this helps. You can always revisit with questions of you need.
  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:  MajorGrubert (CARLOSFERREIRAPINTO)
6257.40 
Hi BurrMan,

Its working now, before i was saving as .3dm file and not as a .txt (never heard about this scripts before you mention).

Thanks for help and taking the time to make the video. Fantastic.

This is an amazing community!

Cheers

Carlos
  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:  Martin (MARTIN3D)
6257.41 In reply to 6257.5 
Hi Michael,
quote:

I've added in something for the next beta so that the start and end of curve _segments_ can also be retrieved. Right now they can only be gotten for the full curve, not for individual segments. Once this is in place then you would be able to get the segments by doing var segs = crv.getSubObjects(); , then each segment will respond to getStartPt() and getEndPt() in the next beta.


I tested that with todays beta, two selected polylines and the code below. It works fine. Thanks a lot for adding this!

code:
script:
var curves = moi.geometryDatabase.getSelectedObjects().getCurves();
for ( var i = 0; i < curves.length; i++ ) {
	var segments = curves.item(i).getSubObjects();
	for ( var j = 0; j < segments.length; j++ ) {
		var segment = segments.item(j);
		moi.ui.alert( "Curve " + i + "\n" + 
		"Segment " + j + " start: " + segment.getStartPt().x + ", " + segment.getStartPt().y + "\n" +
		"Segment " + j + " end: " + segment.getEndPt().x + ", " + segment.getEndPt().y );
	}
}
  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:  Michael Gibson
6257.42 In reply to 6257.41 
You're welcome Martin, I'm glad that worked!

Also another new thing related to polyline handling in the new beta - for the Rebuild command there's a new "Endpoints" mode which builds a new smooth curve that goes through the endpoints of the current curve's segments rather than sampling points at percentages along the curve's length. This can be useful for building a smooth curve through imported polylines like you sometimes get with PDF or DXF imports. It's basically the same as doing a "Through points" curve snapping each point onto polyline segment endpoints, but doing it all in one go.

- 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
 

Reply to All Reply to All

 

 
 
Show messages:  1-7  8-27  28-42