SketchUcation Plugin Store

 

 

Add vertex on curve at length - or edge on surface at length

Add vertex on curve at length - or edge on surface at length

Postby thomthom » Tue Nov 01, 2011 1:24 pm

Is there any plugins out there that will:

Insert a vertex at a given length on a curve? ( Not like Fredo's Polyline divider, because it changed the curve segments - but just so it inserts a vertex.)

Or even better, given an extruded surface, a vertical line is inserted at a given interval along the surface?

I've lost track of what all the plugins do... :roll:
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17626
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby mitcorb » Tue Nov 01, 2011 2:15 pm

Evidently, Divide is not what you are looking for? And Polyline Segmentor?
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb
Top SketchUcator
 
Posts: 3407
Joined: Sat Mar 22, 2008 2:32 pm
Location: USA
Name: Tim
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: architecture
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby mitcorb » Tue Nov 01, 2011 2:19 pm

For Divide on an arc or edge, select, right click Entity Info. You want one more vertex than the display, for instance. Divide by desired number.

EDIT: Well, if the arc is an edge of a model (closed volume), I see that Divide is not available. But a straight edge is eligible to be divided on the same volume.

EDIT EDIT: Maybe I should read your post more carefully :oops:
Last edited by mitcorb on Tue Nov 01, 2011 2:27 pm, edited 1 time in total.
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb
Top SketchUcator
 
Posts: 3407
Joined: Sat Mar 22, 2008 2:32 pm
Location: USA
Name: Tim
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: architecture
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby thomthom » Tue Nov 01, 2011 2:27 pm

mitcorb wrote:Evidently, Divide is not what you are looking for? And Polyline Segmentor?

No, divide only divides a single element into a given set of segments - so does Segmentor. Segmentor also reshapes the curve, like Polyline Divider does. I just want to insert vertices on the existing curve.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17626
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby mitcorb » Tue Nov 01, 2011 2:29 pm

Ok, See my EDIT, EDIT, EDIT (is there an echo in here?)
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb
Top SketchUcator
 
Posts: 3407
Joined: Sat Mar 22, 2008 2:32 pm
Location: USA
Name: Tim
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: architecture
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby mitcorb » Tue Nov 01, 2011 2:31 pm

Ok so when can we expect this wonderful plugin from you? :mrgreen:
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb
Top SketchUcator
 
Posts: 3407
Joined: Sat Mar 22, 2008 2:32 pm
Location: USA
Name: Tim
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: architecture
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby TIG » Tue Nov 01, 2011 2:38 pm

Not that I know of...

However, it's not so difficult.
You know the start and end edges of the curve - we remember these.
Iterate along the curve's edges from the start one until the accumulated_length of them is beyond the distance you want, then use the last considered segment_edge and 'split' it at the required offset d = distance-accumulated_length-edge.length

[You need to trap for a distance that exceeds the curve's length etc,
Also if you want to split an Arc at a known distance around the circumference (rather than along the segmented 'polygonal' representation of the Arc) you need to do some Math to sweep the start.position.clone new_point through that distance around the true circumference, and then project the center point along the vector to that new_point offset by the radius, you get the intersection of the two 'lines' and then split the affected Arc-segment there, then you move this newly added vertex to its correct location on the true circumference at new_point; reforming the Curve if desired - but then it's no longer an Arc.
You could also toggle the curve's start/end as desired]

You know the new_segment returned from the 'split'.
Your original curve is now split into two with the new_segment added between them.
Get the original curve belonging to the original curve's start_edge, and get its vertices, 'vss'.
Get the vertices of the new_segment, 'vsn'.
Get the new curve belonging to the original curve's end_edge, and get its vertices, 'vse'.
Then verts=(vss+vsn+vse).flatten.uniq
The add group=new_segment.parent.entities.add_group()
group.entities.add_curve(verts)
group.explode

which should now reform the curve back as one piece with the extra segment/vertex added in ?
TIG
User avatar
TIG
Global Moderator
 
Posts: 13987
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby thomthom » Tue Nov 01, 2011 2:40 pm

I was hoping I wouldn't need to...
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17626
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby JClements » Tue Nov 01, 2011 7:13 pm

Thom,
For what it is worth, I have had situations where I had needed such a script (or one that places construction points along a curve at equal intervals).
John
Illustrator
Beaverton, Oregon
User avatar
JClements
Premium Member
Premium Member
 
Posts: 773
Joined: Wed Nov 14, 2007 4:32 pm
Location: Portland/Beaverton, Oregon
Name: JClements
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: illustration, cartoons
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby Rich O Brien » Tue Nov 01, 2011 7:17 pm

There is a plugin that places cpoints along a path. But i can't think of it.
:::Blog:::

I'm a Trimbler now!
User avatar
Rich O Brien
Administrator
 
Posts: 8293
Joined: Fri Oct 31, 2008 9:05 am
Location: Limerick, Ireland
Name: Rich O'Brien
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby Jeff Hammond » Tue Nov 01, 2011 7:36 pm

Rich O'Brien wrote:There is a plugin that places cpoints along a path. But i can't think of it.


maybe you're thinking of 1001bit's divide along edges?

that's what i use when i need to do what TT is asking for (not the surface thing.. rather inserting a vertex along an arc)

you can set it up to where it starts from one end of the curve then places a cpoint at a given distance (though it will keep repeating that distance til it runs out of curve so you may end up with a few extra cpoints)..
you then have to go in and manually modify the vertex.. a bit of a pain but it's the easiest way i've found how to do it so far..

if it worked automagically then, well, that'd be sweet! :D


[edit] example of using said plugin.. i actually use it for something a little different than shown here but this version will keep it simple :)

divide_curve.skp
Please, register (free) to access all the attachments on the forums.
dotdotdot
User avatar
Jeff Hammond
Global Moderator
 
Posts: 4318
Joined: Thu Jan 24, 2008 11:16 pm
Location: newyorkcity
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby sdmitch » Tue Nov 01, 2011 10:20 pm

ThomThom,

The attached plugin will add a vertex at a given interval along a selected curve.
Please, register (free) to access all the attachments on the forums.
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch
 
Posts: 617
Joined: Wed Mar 02, 2011 9:21 pm
Name: Sam
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Beginner

Re: Add vertex on curve at length - or edge on surface at le

Postby Rich O Brien » Tue Nov 01, 2011 10:26 pm

@Sam

You should give this it's own thread. It's a great tool :thumb:

Thank You
:::Blog:::

I'm a Trimbler now!
User avatar
Rich O Brien
Administrator
 
Posts: 8293
Joined: Fri Oct 31, 2008 9:05 am
Location: Limerick, Ireland
Name: Rich O'Brien
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby JClements » Tue Nov 01, 2011 10:42 pm

Very nice. Thank you.

Could a similar script add points at Equal Intervals? Perhaps leave the points selected or grouped after being created?
John
Illustrator
Beaverton, Oregon
User avatar
JClements
Premium Member
Premium Member
 
Posts: 773
Joined: Wed Nov 14, 2007 4:32 pm
Location: Portland/Beaverton, Oregon
Name: JClements
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: illustration, cartoons
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby TIG » Tue Nov 01, 2011 11:17 pm

You can make a list of the new_vertices and then move the old_vertices to their locations [vector_from old_to_new?], using a transform_by_vectors on the new_vertices...

PS: Glad someone can understand what I'm a saying... ;)
TIG
User avatar
TIG
Global Moderator
 
Posts: 13987
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby sdmitch » Wed Nov 02, 2011 12:36 am

JClements wrote:Very nice. Thank you.

Could a similar script add points at Equal Intervals? Perhaps leave the points selected or grouped after being created?


It could select and/or group the construction points but not the individual vertices added to the curve.

thomthom, what kind of "extruded surface" are we talking about? Curved or straight?
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch
 
Posts: 617
Joined: Wed Mar 02, 2011 9:21 pm
Name: Sam
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Beginner

Re: Add vertex on curve at length - or edge on surface at le

Postby JClements » Wed Nov 02, 2011 12:47 am

Hi,

I had in mind the construction points; the user would input how many equal intervals, contruction points would be placed and then grouped.
John
Illustrator
Beaverton, Oregon
User avatar
JClements
Premium Member
Premium Member
 
Posts: 773
Joined: Wed Nov 14, 2007 4:32 pm
Location: Portland/Beaverton, Oregon
Name: JClements
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: illustration, cartoons
Level of SketchUp: Intermediate

Re: Add vertex on curve at length - or edge on surface at le

Postby Jeff Hammond » Wed Nov 02, 2011 12:57 am

sdmitch wrote:ThomThom,

The attached plugin will add a vertex at a given interval along a selected curve.


hmm.. i don't think that's quite right. (or at least what i'm talking about.. maybe i'm mis-understanding TT's question ?)


it's just placing a point along the curve but it's not actual moving the vertex into it's proper place..


as an exaggeration, here's a picture showing an arc with 3 segments.. then it shows how it should look after running the script..

arc_new_vertex.jpg



[EDiT].. well, i reread thomas' original post and i think i'm misunderstanding him :oops:
it looks as if the script you (sam) wrote is what he's looking for
Please, register (free) to access all the attachments on the forums.
dotdotdot
User avatar
Jeff Hammond
Global Moderator
 
Posts: 4318
Joined: Thu Jan 24, 2008 11:16 pm
Location: newyorkcity
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby sdmitch » Wed Nov 02, 2011 2:01 am

Jeff, You are right regarding the arc, the point added is on the existing segment.
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch
 
Posts: 617
Joined: Wed Mar 02, 2011 9:21 pm
Name: Sam
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Beginner

Re: Add vertex on curve at length - or edge on surface at le

Postby thomthom » Wed Nov 02, 2011 8:25 am

Jeff Hammond wrote:hmm.. i don't think that's quite right. (or at least what i'm talking about.. maybe i'm mis-understanding TT's question ?)


it's just placing a point along the curve but it's not actual moving the vertex into it's proper place..

You understood me correctly. :)



sdmitch wrote:thomthom, what kind of "extruded surface" are we talking about? Curved or straight?

An extruded surface from the 2D profile of a curve. It's the shape of a building constant of several curves.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17626
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby TIG » Wed Nov 02, 2011 9:17 am

sdmitch wrote:Jeff, You are right regarding the arc, the point added is on the existing segment.
But as I said in my diatribe... if it's a Arc you can do the Math to work out where the swept start-point will be to become the new point where the new vertex ought to be on the true circumference, so you add the new vertex on the segment as normal then apply an entities transformation on the new vertex to relocate it at that new point that lies on the circumference... The Arc will become a Curve...
TIG
User avatar
TIG
Global Moderator
 
Posts: 13987
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby thomthom » Wed Nov 02, 2011 9:51 am

TIG wrote:
sdmitch wrote:Jeff, You are right regarding the arc, the point added is on the existing segment.
But as I said in my diatribe... if it's a Arc you can do the Math to work out where the swept start-point will be to become the new point where the new vertex ought to be on the true circumference, so you add the new vertex on the segment as normal then apply an entities transformation on the new vertex to relocate it at that new point that lies on the circumference... The Arc will become a Curve...

Are we now talking about a new topic?
(Just trying to catch up to the post since last evening.)
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17626
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby TIG » Wed Nov 02, 2011 10:56 am

No - same topic.
Adding a new vertex on a curve splits a segment.
If the curve is an Arc then we have been considering if the vertex should split a segment AND adjust the vertex so it is on the true circumference too...
TIG
User avatar
TIG
Global Moderator
 
Posts: 13987
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby thomthom » Wed Nov 02, 2011 11:27 am

I see. In terms of what I needed to, no adjustments can be done. But I can see the use of this option.
Just had to check if there was existing plugins I'd missed out of.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17626
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Add vertex on curve at length - or edge on surface at le

Postby sdmitch » Wed Nov 02, 2011 4:51 pm

I have modified the plugin so that, if the the selected entity is an arc, the point is placed in its true position instead of on the segment as before.

Should this be an option?
Please, register (free) to access all the attachments on the forums.
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch
 
Posts: 617
Joined: Wed Mar 02, 2011 9:21 pm
Name: Sam
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Beginner

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Artisan Organic Toolset - a set of powerful organic modeling tools.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: dummy, ignatzmouse, Ken, lrc361, mrossk, turan, wolverine and 12 guests