stippled line variable point spacing from raster
 1-17  18-37  38-57  58-60

Previous
Next
 From:  bemfarmer
10809.38 In reply to 10809.37 
If I rebuild the looped curve, the "double" intersection problems go away.

If I separate a fresh curve, or a rebuilt curve, and then (re) Join it,
then the Intersect script causes "double" intersect points.

It seems like the intersect script is detecting pre-join curve segments???

Sometimes the crossover yields 3 points from intersect.

- Brian

ps I think my mouse has been acting a little strange lately, so I gave it a rap on the mousepad :-)
Seems to have helped with mouse selection.

  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
10809.39 In reply to 10809.38 
Hi Brian, I'm a little confused because previously you wrote:

> Given a (continuous) curve in an ( x, y ) plane, which goes from xMin to xMax, and which for every x, has a single y value.
> (Like for a single valued function.)
> A circle and ellipse do not qualify. The bottom half of a circle would qualify.

But all of the curves you just posted are not function curves like that.

- 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:  bemfarmer
10809.40 In reply to 10809.39 
Hi Michael,

The initial curve was traveling from left to right, without curving back above previous portion, for which it is "easier" to find constant deltaX points.

Since then, I have been trying to extend the curve with it "looping" back, a more difficult curve to place constant deltaX point on.
So I did a bit of experimenting.

A curve crossing over itself, (e.g. figure eight) might be more difficult yet.

Anyway, then I inadvertently trimmed the curve with many lineweb lines, and rejoined it, (without being very aware)
Then the "double" intersect points problem occurred.

Attached is a "left to right" curve, which was trimmed to segments, and rejoined.
The double intersect points problem also occurs with this curve.

I have always thought that a re-Joined curve was the same as the initial single curve, but there must be some difference?
So the curve "remembers" is former segments, unless Rebuild is used?

- Brian

Another thought was that MoI joins curve segments "head to tail", and so apparently knows the sequential order of end points and start points.

Google search of "sort points on curve algorithm" did not seem to be very fruitful.

hmm, I see that spell checker is working on editing posts.

(So I thought I should report an unexpected (for myself) result.)

EDITED: 16 Aug 2022 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:  bemfarmer
10809.41 In reply to 10809.40 
Projecting 10 points on the bottom line, up to the (10 segments but rejoined) curve, also results in 18 points.
( 2 times 8) + 2.
As if each former curve segment is being projected to.
(Same result as intersect.)

- Brian

(I thing MoI4 had similar results, a very brief test.)
  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
10809.42 In reply to 10809.40 
Hi Brian, I'll see if I can get the Intersect command to weed out duplicate intersections. For the current version I guess you would need your script to do that itself.

re:
> I have always thought that a re-Joined curve was the same as the initial single curve, but there must be some difference?
> So the curve "remembers" is former segments, unless Rebuild is used?

Yes Join on curves will generate a parent curve that has a list of head to tail segments in it. It doesn't automatically merge segments together. So if you use Edit > Separate on it it should break apart into the same pieces you had before using Join.

In v5 you can use the Merge command on it to merge segments that meet smoothly into longer segments.

- 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:  bemfarmer
10809.43 In reply to 10809.42 
Thank you Michael.

Merge improvement is good to know.

Using Merge just now, in MoI5beta, and the intersection came out correct.
And Project of bottom line points also came out correct.

One last observation for tonight: MoI5beta:
Using the last .3dm, with 10 vertical LineWeb lines:
(Without Merge)
If the re-joined curve is shifted over a bit, so the LineWeb lines do not intersect the former segment ends,
the intersect occurs correctly, (but of course in different locations.)

- Brian

As expected, Merge does not help with getting correct Intersections or Projections, in MoI4,
(in the current situation anyway).

EDITED: 16 Aug 2022 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:  pressure (PEER)
10809.44 In reply to 10809.43 
Brian,

I've also noticed that Construct > Curve > Isect sometimes gives multiple points when I'm expecting 1. For example, if I draw 3 lines through the origin (by using Grid Snap), select the 3 lines, and run Isect, I get 3 points:

I worried that maybe the redundant points would be at locations around .001 units apart http://moi3d.com/forum/lmessages.php?webtag=MOI&msg=8468.19, so I ran
code:
var pts = moi.geometryDatabase.getSelectedObjects().getPoints();

for ( var i = 0; i < pts.length; ++i )
{
	moi.ui.alert
	(
		'point ' + i + '\n' +
		'x = ' + pts.item(i).pt.x + '\n' +
		'y = ' + pts.item(i).pt.y + '\n' +
		'z = ' + pts.item(i).pt.z + '\n'
	)
}


(Is there an easier way to get accurate point coordinates?)

But, In the case of the location where the curve crosses over itself in WeirdIntersectionOne.3dm

I see that 2 of the points are in exactly the same location and the 3rd is only different along y in the 13th decimal place:

point 0
x = 20.826530612244895
y = 37.74721822498999
z = 0

point 1
x = 20.826530612244895
y = 37.74721822498999
z = 0

point 2
x = 20.826530612244895
y = 37.747218224989986
z = 0

In the example with straight lines above all 3 points are at 0,0,0. I tried moving one of the lines by only .0001 units, thinking that this might cause problems, but the 3 intersection points created look to be at exactly the right locations:

- Peer

  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
10809.45 In reply to 10809.44 
Hi PEER

A brief partial reply on lunch break:

I use the script _PointCoordinates3, which is ParseFloat to 6 decimal places, and does one point at a time.
I think it uses the same data as your script.

I've read in the past that computer binary representations of real numbers are not perfect. They only go to, or are accurate to, a certain number of decimals. The programmer does the best that they can...

3 points sounds like the combination of 3 things, taken two at a time.

I figured that "crossing over" might cause some type of problem.

- Brian
  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:  pressure (PEER)
10809.46 In reply to 10809.45 
Brian,

Thanks for developing _PointCoordinates3. I just took it for a spin and like it.

- Peer

I didn't mean to imply that a difference in the 13th decimal place is a problem. That seems very good to me. Also, this multiple points at an intersection thing hasn't actually caused me any problems.
  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
10809.47 In reply to 10809.46 
Thankyou.
The script had help from about 3 other people, including Michael
- Brian
  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
10809.48 
The RemoveDuplicates command appears at the top of CustomUI scripts screen.
As of MoI4, it removes duplicate points as well as duplicate curves...
The RemoveDuplicates script appears in the MoI4 or MoI5beta commands folder, not in AppData commands folder.

I may be mistaken, but other than CustomUI, MoI does not have a way to see these "extra" commands, like Flip, Make2D, Merge, Rebuild, RemoveDuplicates, etc.


Michael's SelectDuplicates script also finds duplicates, and can allow the user to delete the found duplicates as well.
And it has a tolerance.
https://moi3d.com/forum/index.php?webtag=MOI&msg=7782.8
I just added it to my add-on scripts in AppData.
I suppose that it could be added to the top of CustomUI scripts screen...

- Brian
  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
10809.49 
Draft:
Preliminary outline of script to order pre-existing points on a curve.
The result would be an array or objectlist of the points, in order
from the curve startPt to its endPt. (Flip option?)

Select the curve.
Clone the curve.
MoI5beta: Merge the cloneCurve, to get rid of any former segmentation.
(The cloneCurve probably cannot cross over itself?, or else do...?)

Select the points on the curve.
Remove duplicate points.
Select the desired start point of the cloneCurve.
Compare desiredStartPt with actual startPt of the cloneCurve and Flip cloneCurve if necessary.
Trim cloneCurve with the pre-existing points.
Get the segments, which will be in order from start to end of curve.
Place desiredStartPt in orderedPtList objectlist.
Get the endPt of all of the segments, one by one, and place them in orderedPtLIst.

Delete cloneCurve

- Brian

Maybe there is a better way, or MoI already can order points on a curve?
  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
10809.50 In reply to 10809.49 
Hi Brian,

re:
> Maybe there is a better way, or MoI already can order points on a curve?

You can use the dropPoint( pt ) function on a curve or curvesegment. Given a 3D point it will return a number for the parameter value in the curve's domain. You could then sort by the parameter values in ascending order.

It may be problematic if you have a self intersection though and if you are trying to drop a point right at that self intersection.

- 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:  Larry Fahnoe (FAHNOE)
10809.51 In reply to 10809.48 
Hi Brian,

> I may be mistaken, but other than CustomUI, MoI does not have a way to see these "extra" commands, like Flip, Make2D, Merge, Rebuild, RemoveDuplicates, etc.

I'm somewhat of a minimalist when it comes to making changes to MoI's UI, so rather than using CustomUI, I borrowed Max's Scripts menu and made a stand-alone version called Extras: https://moi3d.com/forum/index.php?webtag=MOI&msg=10353.1 which then makes it easy to see the "extra" builtin commands as well as those that have been added.

--Larry
  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)
10809.52 In reply to 10809.51 
Have you an image of the UI result ?
---
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:  pressure (PEER)
10809.53 In reply to 10809.48 
Brian,

Thanks for pointing out SelectDuplicates.

- Peer
  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
10809.54 In reply to 10809.50 
Thank you very much Michael.

I recall dropPoint() from a while back.

Regarding curve self intersection, (crossover/ overlap), potential problems, options might include:
Ignore it and hope for the best?
Test for it and eliminate the point? Or eliminate the point?
Test for it and work around somehow?
Rely on user to select only "well behaved" curves?

During a google search of ordering points elsewhere on the internet, I remember reading something like:
"once you have the parameter "t"..."
but it was vague and a meaning did not register.

Name of script?
My current name favorite is stippleArray.
Previously the name was going to be luminArray or luminanceArray, or gradientArray, but
Lumin is the name of, or in the name of, several companies and products.

I guess Peer is doing stipple research or stipple addition?

- Brian
  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
10809.55 In reply to 10809.51 
Thank you Larry for the link to your script.

I like your script.
It is alphabetical, ignoring the underline prefix.
It does duplicate listing of some scripts.

(I'm thinking the underline is obsolete?, Or does not add much to the display?)

I do still want a few of the other customUI features...

Maybe MoI6 could have an "detailed" user interface for these "extra" scripts?
Subcategories?, Descriptions? ...

- Brian

I put "extras" in the MoI startup folder in AppData, (Windows 11)

EDITED: 18 Aug 2022 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:  Michael Gibson
10809.56 In reply to 10809.54 
Hi Brian,

re:
> Regarding curve self intersection, (crossover/ overlap), potential problems, options might include:
> Ignore it and hope for the best?
> Test for it and eliminate the point? Or eliminate the point?
> Test for it and work around somehow?
> Rely on user to select only "well behaved" curves?

I don't know enough about what result you're trying to get from your script to advise on this.

But if the goal is to have it work as an adjustable function curve, then it would probably make sense to expect that the curve should not be self intersecting and should have just one y position for every x value.

- 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:  bemfarmer
10809.57 
With GIMP2.10.32, after an ordeal due to not knowing the user interface, I was able to make a gradient that looks much like PEERS.

GIMP2.99.10 is in test phase for eventual GIMP3, but still has tiny icons on 4k monitor. Maybe the icons can be enlarged, after another ordeal.
The user interface apparently has, or will have, differences from older versions.
The newer test version has sRGB.
Transparency setting gone???

- Brian

EDITED: 18 Aug 2022 by BEMFARMER

Image Attachments:
Size: 325.5 KB, Downloaded: 14 times, Dimensions: 1000x500px
  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-17  18-37  38-57  58-60