MoI discussion forum
MoI discussion forum

Full Version: Tiles and tile maps

Show messages:  1-4  5-24  25-44  45-49

From: bemfarmer
12 Nov 2017   [#25]
Very weird.
I renamed nodeeditor directory, and reinstalled version 0.97 to a new nodeeditor directory, and loaded Jame's extension subdirectory.
Same 30 second, error message.
(One time MoI crashed.)


Also tried computer reboot.

Tried loading nod from shortcut key, same result.

- Brian
From: Max Smirnov (SMIRNOV)
12 Nov 2017   [#26] In reply to [#25]
Hi Brian,
Right now I tested this node with NE 0.95, 0.97, 0.98 using Win and Mac versions. ~5 seconds. No errors on Apply.
Try to rename moi.ini file and run MoI with default settings.
From: bemfarmer
12 Nov 2017   [#27] In reply to [#26]
Thank you Max.

I saved my current Moi.ini file, by renaming it.
I was unable, so far, to locate default Moi.ini, but saw one called MarvsMoi.ini, from 2015, and renamed it Moi.ini.

Success running the truchetSweep3 nod, about 6 seconds., and apply works, 0.97 version.

So something in my previous moi.ini file causes the previous failure...

- Brian
From: bemfarmer
12 Nov 2017   [#28] In reply to [#27]
OK, reverted to my moi.ini file that caused the problem.
My mesh angle was set to 1, (very low).
Changed mesh angle to 15, and now the truchetSweep3 nod works just fine.
(Maybe caused a memory problem with too low a mesh?)

- Brian
From: Michael Gibson
12 Nov 2017   [#29] In reply to [#28]
Hi Brian, yes a mesh angle of 1 degree will generate very dense display meshes. That would make it likely to run out of memory when dealing with more complex geometry and also take quite a bit more time as well.

- Michael
From: Max Smirnov (SMIRNOV)
12 Nov 2017   [#30] In reply to [#28]
Hi Brian,

I set angle to 1 and reproduced this error. I'll add a couple of checks in Output node to avoid this error, but first I'll test NE with upcoming MoI v4.
Also it seems that mesh angle affects on factories performance, so it will be better to use larger values with nodeeditor.
From: bemfarmer
13 Nov 2017   [#31]
Thanks Michael, Max, and James.
- Brian
From: bemfarmer
14 Nov 2017   [#32]
Under MoI4, my incomplete draft 2D truchet tile (.js) script is lightning fast, with no edge "flicker". :-)
- B
From: Michael Gibson
14 Nov 2017   [#33] In reply to [#32]
Hi Brian, yeah that will be because of the change in threading model for how scripts are run. In MoI v3 scripts were run in a separate process and used inter-process communication with MoI.exe to retrieve properties and such. That has a fair amount of overhead but it also made it difficult for an errant script to lock up MoI because it could be torn down any time by killing the worker process. In V4 the .js script file for a command is run on the main thread so there's no interprocess communication (same as if in V3 you moved your code over to the .htm file) so a lot less overhead, but it's also easier for it to lock things up if it doesn't behave well like if it just churns away continuously in a loop too much.

- Michael
From: bemfarmer
16 Nov 2017   [#34]
Using Notepad++ only, I just lost 1.5 hours work on my draft script documentation, despite multiple saves :-(
And I was doing such a good job too.

- Brian
From: Mike (MGG942)
16 Nov 2017   [#35] In reply to [#34]
Bummer.
What happened?
From: bemfarmer
16 Nov 2017   [#36] In reply to [#35]
Hi Mike,
I made a bunch of edits of documentation, saving about a dozen times.
Then I decided to close Notepad++. There was a message that some directory was gone, and did I want to save the file.
I clicked yes, , and that was the end of my file, but I still have the one from yesterday.
Note that Notepad++ will sometimes backup to appdata, and that there is a 3 level backup system under Notepad++/Settings/Preferences/Backup
none, simple, and verbose. In ignorance, mine was set to none. Now it is set to simple.
( I have had some recent file copy problems/weirdness...)
- Brian
From: Michael Gibson
16 Nov 2017   [#37] In reply to [#36]
Hi Brian, I'd be worried that your hard drive may be dying. Might be a good time to make a full disk image backup to an external drive, and try to check SMART status https://www.howtogeek.com/134735/how-to-see-if-your-hard-drive-is-dying/

- Michael
From: bemfarmer
16 Nov 2017   [#38] In reply to [#37]
Thanks for the link Michael.
CrystalDistkInfo says drive are good.
I'll do a backup this PM...
Cdrive is SSD, and I also have D and G drive.

- B
From: Mike (MGG942)
16 Nov 2017   [#39] In reply to [#36]
So is mine - now!
Thanks for the tip.
From: bemfarmer
16 Nov 2017   [#40] In reply to [#39]
One web place said to use the "verbose backup."
- B
From: bemfarmer
23 Nov 2017   [#41]
Hi Michael,

Given an objectlist filtered from MoI's geometry database, containing say BRep surfaces and Curves,

Is there javascript code to determine the object.type of the various objects in the objectlist?

The question is asked, because Curves do not contain .edges, and I am hiding .edges after using copy.

(Alternatively, I can filter the geometry database, and get two objectlists, and hide the edges for the BReps, and then concatenate the Curves.)


function selectTileCurves( tileName )
{
//var objs = moi.geometryDatabase.getObjects();
//Next line is a test line, to select only curves.
var objs = moi.geometryDatabase.getObjects().getCurves();
//Next line is a test line, to exclude curves.
//var objs = moi.geometryDatabase.getObjects().getBReps();
for ( var i = 0; i < objs.length; ++i )
{
var obj = objs.item(i);
if ( obj.name == tileName )
obj.selected = true;
}
}

The question is also asked, because if edges are not hidden, boundaries between surfaces do not look as good.
(unhidden edges do work well visually, if there is only one surface, with screen background.)

Having one Curve at the boundary improves the visual look, by reducing "pixel jaggedness."

- Brian

(I have the truchet tile script working well, but am trying to tune up the boundaries between colors or tones, with hidden edges.
I have code from the forum to hide the edges.)
From: Michael Gibson
23 Nov 2017   [#42] In reply to [#41]
Hi Brian, there is an object.type but it gives it as a number code. Here's a helper function get_type that will return a string type:

code:
function get_type( obj )
{
    switch(obj.type)
    {
    case 1: return 'CurveSegment';
    case 2: return 'Curve';
    case 3: return 'BRep';
    case 4: return 'Face';
    case 5: return 'ConstructionLine';
    case 6: return 'PointObject';
    case 7: return 'MeshObject';
    
    case 0:
    default: return 'Unknown';
    }
}

var objs = moi.geometryDatabase.getObjects();
for ( var i = 0; i < objs.length; ++i )
{
    var obj = objs.item(i);
    moi.ui.alert( get_type(obj) );
}


- Michael
From: mkdm
23 Nov 2017   [#43] In reply to [#42]
Hello Michael.

Please correct me if I'm wrong :)

But...the method you gave us I think is not suitable to distinguish a "curve" from an "edge" because both are curves.

I use a very coarse and manual method to be sure that a curve is "only" a curve.
I write here in "pseudo-code" :

code:
1) SelectedCurves = moiSelectedObjects.getCurves();
2) SelectedEdges = moiSelectedObjects.getEdges();
3) I perform a loop on the set "SelectedEdges"
4) Because every single entity in Moi has the "id" property,
IF the "id" of a "SelectedCurves"'s element is not into the set "SelectedEdges",
THEN that entity is a "simple curve" and not and "edge"


Thanks in advance.

Ciao.

Marco (mkdm)
From: Michael Gibson
23 Nov 2017   [#44] In reply to [#43]
Hi Marco, yes you're right. There are also these properties on an object you can access on an object for distinguishing that:

obj.isBRepSubObject - true if object is a sub-object inside a brep.
obj.isCurve - true if it's either a standalone curve or an edge curve.
obj.isEdgeCurve - true if it's an edge curve.
obj.isLaminaEdgeCurve - true if it's a "naked" edge curve that isn't joined to another.
obj.isJoinedEdgeCurve - true if it's not a naked edge.
obj.isSeamEdgeCurve - true if it's a joined edge but its the seam of a closed surface so it's the same face on either side of it.
obj.isStandaloneCurve - true if it is a standalone curve and not an edge curve.
obj.isCurveSegment
obj.isEdgeCurveSegment
obj.isBRep
obj.isSolidBRep
obj.isOpenBRep
obj.isSingleFaceBRep
obj.isFace
obj.isConstructionLine
obj.isPointObject
obj.isMeshObject
obj.isTopLevelObject

- Michael

Show messages:  1-4  5-24  25-44  45-49