stippled line variable point spacing from raster
 1-20  21-40  41-60

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

Previous
Next
 From:  bemfarmer
10809.58 
With Windows 11, the taskbar can be set to be a tiny sliver at the bottom of the screen.
Hover over it opens up the taskbar.
RightClick taskbar brings up Setting > Personalization, go to Taskber behavior > Checkbox: "Automatically hide the taskbar"

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

> 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?)

Hmm, I've not noticed it duplicating scripts in my usage. I wonder though, do you happen to have something like two scripts named foo.js and _foo.js? That would produce an apparent duplication, but only because there were two scripts with related names. If you can provide any other clues as to what you're seeing of this duplication I'd appreciate them.

I believe the underscore prefix was an early means of keeping users' scripts separate from MoI's scripts & is now unnecessary with AppData/commands. However since the prefix is part of the name I wanted to display it, but alpha sorted as you note.

--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
 From:  bemfarmer
10809.60 
This site explains RBG colors well, and the mouse can hover over a color to see the values.
https://www.rapidtables.com/web/color/RGB_Color.html
There are other tables as well.

Let a gradient be 256 pixels wide.
There are only 256 values for each R, G, or B number.
So a gradient made up of grey colors, from White to Black, could have RGB numbers such
that Rnum = Gnum = Bnum, in the integer range of 0...255.
The numbers for White are ( 255, 255, 255 )
The numbers for Black are ( 0, 0, 0 )
The average of the three numbers could be used.
To add up various sums of numbers, each should be subtracted from 255, to invert a White to Black gradient, to calculate when a sum exceeds a threshold number. (Assuming MoI points are more dense for darker regions.)
For 256 pixels the sum of the numbers could be an arithmetic series. As well as sums of sequential terms of subsets of the values.

The number of terms whose sum exceeds a threshold number can be calculated, with other than brute force:
https://math.stackexchange.com/questions/1624580/how-many-terms-in-arithmetic-series-where-sum-1000

Such a gradient image that is 512 pixels wide could have pairs with the same average value of the pixels.

- Brian

EDITED: 19 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
 

Reply to All Reply to All

 

 
 
Show messages:  1-20  21-40  41-60