Author Topic: MophMuse V 1.0.0.0 (Pre-release)  (Read 18829 times)

Offline rymaeda

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #15 on: October 21, 2025, 04:10:56 am »
Hi Geoff,

1) I believe this issue occurred in earlier versions of the plugin. I removed the form, but there was still a message box for cases where no valid selections were made. That’s been removed.
2) Adjusted the versioning. Hopefully it worked.
3) Implemented an internal conversion and tested it with circle, rectangle, arc, line, polyline, and spline. It worked, but rotating the rectangle breaks the algorithm. I’ve run into this issue before, and as far as I remember, the fix is simple — I just need to look it up in my files. But I’ll leave that for later.

Thanks a lot for the great feedback!

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #16 on: October 21, 2025, 07:34:44 am »
I have tried out v1.3.87, and it is almost there. The closed shape can be polyline, polyrectangle or circle, but a closed spline does not seem to work.  The open spline works as the shape to be swept around the closed shape.  An arc also works
Geoff

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7577
    • View Profile
    • Cambam V1.0 French Doc
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #17 on: October 21, 2025, 18:57:12 pm »
For  the rotated rectangle, you must convert it to polyline first, then "apply transformations" on the polyline to reset the transformation matrix.

++
David

Offline rymaeda

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #18 on: October 23, 2025, 23:02:36 pm »
I have tried out v1.3.87, and it is almost there. The closed shape can be polyline, polyrectangle or circle, but a closed spline does not seem to work.  The open spline works as the shape to be swept around the closed shape.  An arc also works

It was just another bug, I think it's resolved now. Thanks for testing and for your patience.

For  the rotated rectangle, you must convert it to polyline first, then "apply transformations" on the polyline to reset the transformation matrix.

When the same issue occurred with the other plugin, it was resolved using the following code snippet:

Code: [Select]
                        if (poly.CanConvertToPolylines == true)
                            poly = poly.ConvertToPolylines(true)[0];

I even tried applying transformations, but just like last time, without success.

Big thanks!!

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7577
    • View Profile
    • Cambam V1.0 French Doc
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #19 on: October 24, 2025, 04:09:25 am »
Quote
I even tried applying transformations, but just like last time, without success.

without success after applying transformation or without success to apply transformation (the code to apply it is not very intuitive!)

I don't know the C# syntax, but in VB it is the following:

Code: [Select]
Dim ent As Entity

...
...

' apply transformations

If ent.ApplyTransformation() Then
   ent.Transform = Matrix4x4F.Identity
End If

..
..

here, it is applied to an entity, seems it can be applied directly to a polyline or other drawing object.

VB seems to accept:

Code: [Select]
Dim p As Polyline

p.Transform = Matrix4x4F.Identity

maybe it can works directly on a polyrectangle through the programming way, even if it do not works through the manual way (menu Edit/transform/apply transformation on a rotated polyrectangle do nothing)

Edit: I just have a try with VB, even through programming, applytransfomation do not works directly on a polyrectangle, it must first be converted to a polyline.

Edit2: seems to works well even with the rotated polyrectangle on your example.

very nice work !!

++
David
« Last Edit: October 24, 2025, 04:42:56 am by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5329
  • Made in England
    • View Profile
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #20 on: October 24, 2025, 14:56:26 pm »
Here's some code from my fretboard plugin.

It takes a reference to a spline ( sp ), rotates it in X then translates it -15 in Z. The last line is the important bit.

Code: [Select]

sp.Transform.RotX(Math.PI / 2);
sp.Transform.Translate(0, 0, -15);
if (sp.ApplyTransformation()) { sp.Transform = Matrix4x4F.Identity; sp.Update(); }

« Last Edit: October 24, 2025, 14:58:08 pm by EddyCurrent »
Filmed in Supermarionation

Offline rymaeda

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #21 on: October 28, 2025, 00:30:56 am »
Hello!

Eddy, the issue that's occurring is that when selecting rotated polyrectangles, the plugin completely ignores the rotation — it seems to be a particular behavior of polyrectangles.

From what I understood, you're both suggesting something like this:


Code: [Select]
if (poly.ApplyTransformation())
{
    poly.Transform = Matrix4x4F.Identity;
    poly.Update();
}


I tried applying it to the code like this:


Code: [Select]
case Polyline poly:
    if (poly.ApplyTransformation())
    {
        poly.Transform = Matrix4x4F.Identity;
        poly.Update();
    }
    if (poly.Closed) closedPolys.Add(poly);
    else openPolys.Add(poly);
    break;


But it didn’t make any difference.

On the other hand, I was able to simplify the code I was using down to a single line:

Code: [Select]
poly = poly.ConvertToPolylines(true)[0];

So the code now looks like this:


Code: [Select]
case Polyline poly:
    poly = poly.ConvertToPolylines(true)[0];
    if (poly.Closed) closedPolys.Add(poly);
    else openPolys.Add(poly);
    break;


Could this have any unintended side effects?

very nice work !!

It's been very rewarding — the methods used aren't sophisticated, but the result is quite reasonable.

Have a great week!
« Last Edit: October 28, 2025, 00:39:38 am by rymaeda »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7577
    • View Profile
    • Cambam V1.0 French Doc
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #22 on: October 28, 2025, 01:12:32 am »
Quote
I tried applying it to the code like this:


Code: [Select]

case Polyline poly:
    if (poly.ApplyTransformation())
    {
        poly.Transform = Matrix4x4F.Identity;
        poly.Update();
    }
    if (poly.Closed) closedPolys.Add(poly);
    else openPolys.Add(poly);
    break;



But it didn’t make any difference.

Yes, it is what I said on a previous post,     poly.Transform = Matrix4x4F.Identity; is not working if applied on a polyrectangle, you must first convert it to a polyline then apply transformation on the resulting polyline.

++
David


Offline rymaeda

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: MophMuse V 1.0.0.0 (Pre-release)
« Reply #23 on: November 02, 2025, 18:51:24 pm »
Yes, it is what I said on a previous post,     poly.Transform = Matrix4x4F.Identity; is not working if applied on a polyrectangle, you must first convert it to a polyline then apply transformation on the resulting polyline.

Aha, I see, now, what you pointed out, David.

But applying ConvertToPolylines(bool x) to polyrectangles does all the magic—If I'm not mistaken regardless of whether the argument is true or false. So we don't need to explicitly apply the transformations.

Excellent week!