Eliseo
March 20, 2018, 9:01am
1
Hi @Dale @will ,
When the size of the mesh that you are going to morph is large then it gives this error:
The code that generates this error during execution is:
Mesh m2d;
GeometryBase geom;
//Where m2d is the mesh with less resolution
//geom is the mesh with full resolution
morph = new TMorphTranslateMesh( );
morph.SetWorkingMeshes( ref m2d );
morph.PreserveStructure = false;
morph.QuickPreview = true;
morph.Tolerance = 1.0;
resultMorph = morph.Morph( geom );
class TMorphTranslateMesh : SpaceMorph
{
Point3d pt3d;
private Mesh m2d;
public override Point3d MorphPoint( Point3d pt2d )
{
pt3d = pt2d;
cp = m2d.ClosestMeshPoint( pt2d, 0.0 );
[...]
return pt3d;
}
This is an example that makes it fail
Error de Morph.3dm (10.7 MB)
Eliseo
March 22, 2018, 1:20pm
2
Hi @Dale , @will
Have you been able to look at something on this topic?
Thanks
dale
(Dale Fugier)
March 22, 2018, 11:04pm
3
Hi @Eliseo ,
Can you provide source code for a sample command, that I can run here, that does not work for you?
— Dale
Eliseo
March 23, 2018, 8:58am
4
Hi @dale
Yes of course, here you have the code
using Rhino.Geometry;
using Rhino.Input.Custom;
using Rhino.DocObjects;
internal class MorphExample: SpaceMorph
{
private Point3d pt3d;
private Mesh m2d;
private MeshPoint cp;
internal MorphExample( )
{
m2d = null;
}
internal void SetWorkingMeshes( ref Mesh _m2d )
{
m2d = _m2d;
}
public override Point3d MorphPoint( Point3d pt2d )
{
pt3d = pt2d;
cp = m2d.ClosestMeshPoint( pt2d, 0.0 );
return pt3d;
}
}
internal bool example( )
{
Mesh m2d, m;
MorphExample morph;
GeometryBase geom;
GetObject go, go2;
go2 = new GetObject( );
go2.SetCommandPrompt( "Select FULL mesh" );
go2.GeometryFilter = ObjectType.Mesh;
go2.EnablePreSelect( false, false );
go2.Get( );
if ( go2.CommandResult( ) != Result.Success ) return false;
go = new GetObject( );
go.SetCommandPrompt( "Select SIMPLE mesh" );
go.GeometryFilter = ObjectType.Mesh;
go.EnablePreSelect( false, false );
go.Get( );
m2d = go.Object( 0 ).Mesh( ).DuplicateMesh( );
if ( m2d == null ) return false;
morph = new MorphExample( );
morph.SetWorkingMeshes( ref m2d );
morph.PreserveStructure = false;
morph.Tolerance = 1.0;
geom = go2.Object( i ).Geometry( ).Duplicate( );
if ( SpaceMorph.IsMorphable( geom ) )
morph.Morph( geom );
return true;
}
Is this enough for you?
Please, try it with the example provided above. The “FULL” mesh is the mesh with a lot of poligons,
Eliseo
dale
(Dale Fugier)
March 23, 2018, 7:29pm
5
Hi @Eliseo ,
I am able to repeat what you are seeing. I’ve reported the issue.
https://mcneel.myjetbrains.com/youtrack/issue/RH-45038
– Dale
Eliseo
March 26, 2018, 6:36am
6
OK thanks
Just tell you that the error is extendable to any type of morph, not just the spacemorph
Eliseo
Eliseo
March 28, 2018, 10:45am
7
Hi @dale , @stevebaer
I can not distribute our plugin in Rhino 6 until this bug is fixed. Do you know when it will be fixed more or less?
Thanks
dale
(Dale Fugier)
March 28, 2018, 3:05pm
8
Hi @Eliseo ,
What is your plug-in? Is it on Food4Rhino ?
– Dale
Eliseo
April 3, 2018, 6:45am
9
No, it is icad3DP / Sole3D
Eliseo
April 13, 2018, 6:41am
10
Hi @dale ,
If you need help or more examples, let me know. Everything seems to indicate that the error is generated in the morhpoint
Eliseo
Eliseo
May 16, 2018, 1:26pm
11
Hi @dale
There is an update of Rhino 6 on 04/05/2018 (6.4.18124.12321), Do you know if the issue
https://mcneel.myjetbrains.com/youtrack/issue/RH-45038
has been updated in this version or will it not be available until SR 5?
Thanks
dale
(Dale Fugier)
May 16, 2018, 3:31pm
12
Hi @Eliseo ,
Yes, the fix will be available in SR5.
– Dale