Author Topic: getting rubberband of contour  (Read 3052 times)

0 Members and 1 Guest are viewing this topic.

CADwiesel

  • Newt
  • Posts: 46
  • Wir machen das Mögliche unmöglich
getting rubberband of contour
« on: February 22, 2018, 05:23:54 AM »
Im trying to get an Polyline arround an contour like an rubberband would like to fit arount this.
Like this white Pl arrount this magenta figure.
May there are some Ideas to solve this?
My first idea was to connect each Point with each other Point, than generate an Boundingbox arround with a little bigger size. after this i use the boundary methode to generate the boundary. Maybe it generates some more boundarys, but the biggest would be my soloution.
What are other ideas?

Best Regards
CADwiesel
« Last Edit: February 22, 2018, 05:46:30 AM by CADwiesel »
Gruß
CADwiesel
Besucht uns im CHAT

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: getting rubberband of contour
« Reply #1 on: February 22, 2018, 08:20:25 AM »
Use this in conjunction with this and you have a solution.  :-)

CADwiesel

  • Newt
  • Posts: 46
  • Wir machen das Mögliche unmöglich
Re: getting rubberband of contour
« Reply #2 on: February 22, 2018, 09:43:56 AM »
Thanks Lee, that's a great algorithm!
Gruß
CADwiesel
Besucht uns im CHAT

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: getting rubberband of contour
« Reply #3 on: February 22, 2018, 01:09:18 PM »
Thanks Lee, that's a great algorithm!

You're welcome - all credit to Ronald Graham  :-)

ScottMC

  • Newt
  • Posts: 193
Re: getting rubberband of contour
« Reply #4 on: March 02, 2018, 10:10:25 PM »
Handy tool! Thanks Lee

rayakmal

  • Newt
  • Posts: 53
Re: getting rubberband of contour
« Reply #5 on: March 03, 2018, 04:00:44 AM »
Use this in conjunction with this and you have a solution.  :-)

The second function creates double points on some vertexes when I choose a Polyline (transition from a curve to another curve).
Nevertheless, your functions are always of great help, Lee.
« Last Edit: March 03, 2018, 09:34:41 AM by rayakmal »

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: getting rubberband of contour
« Reply #6 on: March 03, 2018, 07:55:27 AM »
Handy tool! Thanks Lee

You're welcome!  :-)

Use this in conjunction with this and you have a solution.  :-)

The second function creates double points on some vertexes when I choose a Polyline (transition from a curve segment to a straight segment).

Could you please upload a sample drawing containing a polyline which demonstrates this so that I may investigate?

Nevertheless, your functions are always of great helpful, Lee.

Glad to hear it  :-)

rayakmal

  • Newt
  • Posts: 53
Re: getting rubberband of contour
« Reply #7 on: March 03, 2018, 08:38:47 AM »
Could you please upload a sample drawing containing a polyline which demonstrates this so that I may investigate?

Here it is.

EDIT:
When I converted the object into a LWPolyline, the functions work perfectly. Problem Solved.
« Last Edit: March 03, 2018, 09:49:05 PM by rayakmal »

CADwiesel

  • Newt
  • Posts: 46
  • Wir machen das Mögliche unmöglich
Re: getting rubberband of contour
« Reply #8 on: March 05, 2018, 08:24:31 AM »
I also found an behavior with bigger arc's inside. the calculated Points on the arc are to less. But changing the Function to calculate more Points
Code: [Select]
....(fix (* 35.0 (/ di2..... up to
Code: [Select]
.....(fix (* 700.0 (/ di2..... solves this.
Gruß
CADwiesel
Besucht uns im CHAT

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: getting rubberband of contour
« Reply #9 on: March 05, 2018, 08:36:01 AM »
I will update the code on my site tonight to resolve these issues.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: getting rubberband of contour
« Reply #10 on: March 08, 2018, 02:57:35 PM »
I have now updated the code for this function to hopefully resolve these issues - you are welcome to download the new version here.

CADwiesel

  • Newt
  • Posts: 46
  • Wir machen das Mögliche unmöglich
Re: getting rubberband of contour
« Reply #11 on: March 09, 2018, 02:11:37 AM »
Hi Lee, now you let the user descide how much Points are calculated for an Arc or Polyline. But in my opinion its nessecary to do the calculation automaticly. I tryed it with an Polyline included an long bulge with an big radus. In this case i have to take an value of 700 to calculate as much points on this radius as needed for an arc like soloution. If you only uses an value of 70 it calculate only a vew points on this bulge. But for an small arc 700 is as much as needet for this arc to get this arc like soloution.
I think an soloution is needet which calculates automaticly as mutch as nessesary for an smooth arc.

Gruß
CADwiesel
Besucht uns im CHAT