Show messages:
1-8
…
389-408
409-428
429-448
449-468
469-488
489-508
509-528
…
629-639
From: Michael Gibson
Hi Larry, I've updated a couple of scripting things for the next v5 beta to help with that.
The first thing is that all MoI script objects implement a .toString() function that will return the specific object name rather than a generic "MoiObj" name which used to be returned for every object previously.
So for example this:
var obj = moi.geometryDatabase.createObjectList();
var text = obj.toString();
will now generate [object ObjectList] instead of [object MoiObj].
Then the other thing is that property enumeration using the "for...in" syntax will now work on MoI script objects which wasn't implemented previously. Methods will also show up in the enumeration as properties that have a value of '[object Function]'.
So that should enable making a dump function like you're asking about, something like:
code:
function dump( obj )
{
var text = obj.toString();
for ( propname in obj )
text += '\n' + propname + '=' + obj[propname].toString();
return text;
}
- Michael
From: Larry Fahnoe (FAHNOE)
> Hi Larry, I've updated a couple of scripting things for the next v5 beta to help with that.
Wow, thanks Santa!! :-)
> will now generate [object ObjectList] instead of [object MoiObj]
That will be quite nice as it is a bit frustrating to see [object MoiObj] when what I really wanted to see was *which* MoI object it was.
> Then the other thing is that property enumeration using the "for...in" syntax will now work on MoI script
> objects which wasn't implemented previously. Methods will also show up in the enumeration as
> properties that have a value of '[object Function]'.
I think this along with your example dump() will go a long way towards helping script developers have some better insight into the objects
being used. Maybe someday the methods could be fleshed out with their parameters which then makes them somewhat self-documenting.
I'd vote to see dump() show up as dump.js in MoI so that other scripts could simply #include and use it, along with mentions in the release
notes or command reference of course. :-)
Many thanks for such a quick solution!!
--Larry
From: pressure (PEER)
Thanks Michael and Larry! Sounds like some handy new functionality.
From: Matadem
Good day.
This probably was requested at some time....
Ussually I work in Moi3d and then import in Vectric.
The request would be distort and or the ability to group items and then distort.
Hope this can make it in future version.
Thank you!
Image Attachments:
Node distort.jpg
From: Michael Gibson
Hi Matadem,
re:
> The request would be distort and or the ability to group items and then distort.
>
> Hope this can make it in future version.
You can do that in the current version using the Transform > Deform > Flow command.
Set up one plane underneath your curves, copy the plane and edit its points to distort it and then use Transform > Deform > Flow to map from the base plane to the distorted one. Note - make sure you edit the points on the distorted one, don't form a trimmed surface using Construct > Planar because that has a non-distorted plane as its underlying surface:
- Michael
Image Attachments:
flow_distort1.jpg
flow_distort2.jpg
From: Matadem
Thank you for the reply.
Maybe I should have used the word warp.
I just found out yesterday that new affinity designer v2 have warp and dxf import not export.
This is wat I refer to
https://www.youtube.com/watch?v=xGZqXYd1czw
If something like this could make it into Moi3d ...warp your designs, your 3d model or warp your design than extrude it would be great.(cnc cutters, vinyl cutters and laser cutters :D ).
Thank you!
Message 10114.455 was deleted
From: Michael Gibson
Hi Matadem,
re:
> If something like this could make it into Moi3d ...warp your designs, your 3d model or warp your
> design than extrude it would be great.(cnc cutters, vinyl cutters and laser cutters :D ).
Yes, there is a "Flow" function already in Moi under Transform > Deform > Flow that can be used for doing similar things now:
https://moi3d.com/4.0/docs/moi_command_reference8.htm#flow
To use it you set up 2 surfaces, one is a rectangle surface under your base objects and the second one is a deformed target surface.
Here's an example in MoI:
- Michael
Image Attachments:
flow_warp1.jpg
flow_warp2.jpg
flow_warp3.jpg
From: Psygorn (DRILLBIT)
Hello Michael,
Is it possible to have the following ability (or do we have it currently) :
To be able to have control points of a curve duplicated by holding Ctrl/Command key. (If I want to elaborate on it better I would say please take a look at the attached image. in the image you can see a circle with half of its control points selected I would like to be able to duplicate those selected control points and adjust the shape of the curve by moving selected control points to the right side getting the second curve u see below the circle) (I imagine this could be helpful because it works even faster in some cases) (and it is just a thought)
From: Frenchy Pilou (PILOU)
Maybe Flow function can do that again... ?
From: bemfarmer
Extrude with Set Path looks promising, with a semicircle as initial curve.
A few additional steps would be needed...
Maybe a short script could be done...
- Brian
From: Michael Gibson
Hi Psygorn,
re:
> To be able to have control points of a curve duplicated by holding Ctrl/Command key.
Currently if you hold down the Ctrl key when you drag on an object it will drag a copy of the object, including if you drag control points.
- Michael
From: Psygorn (DRILLBIT)
Hi Michael,
Yes I just thought out loud ( just thought this could open a fast way to manipulate curve shapes for example turning a circle into a pill shape ) Just a thought!
and maybe my explanation was not good I meant I just want control points to be copied. Currently when we Ctrl+drag the control points the curve is also copied with them.
It was just a thought dear Michael. I apologize if it sounds absurd! sorry.
From: Psygorn (DRILLBIT)
Hi bemfarmer,
I meant I wish I could only duplicate control points when holding Ctrl+drag on them. and I thought maybe with this ability (being able to copy only control points then we could be able to manipulate curves shapes with more speed.
For example imagine u could create pillshape just by selecting half of the control points of a circle and drag them to another side. It was just a thought!
From: Michael Gibson
Hi Psygorn,
re:
> and maybe my explanation was not good I meant I just want control points to be copied. Currently
> when we Ctrl+drag the control points the curve is also copied with them.
>
> It was just a thought dear Michael. I apologize if it sounds absurd! sorry.
Hmmm, well looking more closely at your example it looks like only 2 of the points out of the ones you selected are copied:
Then there are 4 completely new points inserted that do not correspond to any previous point, so those are not really "copies":
I'm sorry but it would be pretty strange to have a dedicated keyboard shortcut that would copy only some of the current selected points, not all of them, and then additionally insert new points that work just for this one very specific case of making a pill shape.
In the future I do want to add some symmetry editing tools, maybe those would help with this particular case as well.
- Michael
Image Attachments:
psygorn_control_points1.jpg
psygorn_control_points2.jpg
From: Psygorn (DRILLBIT)
Ah ok, Tanx :)
Edit: Dear Michael, I did the following to make pill shape -> Trimmed a Circle put a distance between the produced semi circles and then connected them with two lines and joined them I guess that is why there are more points. However, while I was doing it I thought if we could just select half of the control points and then drag them to another side while holding down control and ending up with the pill shape we could have a faster work fellow. I thought this Idea is aligned with the philosophy behind MOI3D which is "Speed". But now I think I need to apologize maybe my idea is not a good one! sorry! and thank you for your time. :-)
From: Michael Gibson
Hi Psygorn, no problem. But yes the trim does end up inserting some key points to make a result that keeps the circular shape intact.
If you just tried to move control points alone it's not going to be very feasible to get a result that has shaping of exact circular arcs connected by straight lines.
Instead of straight lines it's going to be kind of smoothed out something like this:
re:
> I thought this Idea is aligned with the philosophy behind MOI3D which is "Speed".
It's true that is an important thing. But another part to the philosophy behind MOI3D is to try and keep things streamlined and simple to use and avoid "bloat".
Too many special functions that are used just in really specific cases can end up crowding the UI so much that it becomes more difficult to use overall.
So it would help if there were other kinds of situations where something like that would be useful.
If it's only useful for making pills then the anti-bloat philosophy means that it's preferable to use a combination of existing general purpose tools to make it just like you did use.
Thanks,
- Michael
Image Attachments:
psygorn_control_points3.jpg
From: Larry Fahnoe (FAHNOE)
A Christmas puzzle for Michael?
What about a “nearest neighbor" GeomObject method: given a vector for direction and an optional distance limit, the method would return the next GeomObject along the vector within the limit.
An example use case would be a script modifying a stack of objects where it is inconvenient to select the objects in advance but the user could supply a distance tolerance. The objects may be immediately adjacent to one another or there may be gaps and this would be left to the calling script to control.
An alternative process, using existing capabilities is to use a line and intersect, but that has challenges and limitations. A nearest neighbor method would create possibilities for scripts to examine the model environment. I have no idea of the effort required to implement such a method, but offer it as an idea for your consideration.
Merry Christmas and THANK YOU for MoI, it is a delightful tool!
--Larry
From: Michael Gibson
Hi Larry,
re:
> An alternative process, using existing capabilities is to use a line and intersect, but
> that has challenges and limitations.
Could you describe what the challenges and limitations would be?
- Michael
From: Larry Fahnoe (FAHNOE)
Hi Michael,
> Could you describe what the challenges and limitations would be?
The challenge is primarily complexity of the script as it is trying to knit together an understanding of the model it is working on and only do a limited set of operations. One limitation is if the list of objects fed to the intersect is too broad there may be other intersections that generate points which are unrelated & this would lead toward more complexity to eliminate those points. There may be other issues I’ve not tripped over yet...
So for example, see the attached model. The structure on the right represents a building with ICF (insulated concrete form) walls which are poured. The concrete in the 4 walls is represented as a single solid and I represented the foam insulation layers in the same way. There are also solids representing drywall on the inside and siding on the outside. The goal is to cut and frame a single window on one side. To do that one needs to select only the faces that are to be cut rather than simply selecting all the wall components. The process of manually selecting only the faces associated with one wall with the UI is cumbersome and would ideally be done by the script. My script currently uses the subset boolean difference that you suggested earlier and therefore cuts windows on both sides of the building if the entire wall structure is selected (which is the result that is currently shown).
I believe I can identify the necessary faces per Peer's suggestion of using using BRep’s dropPoint().
https://moi3d.com/forum/index.php?webtag=MOI&msg=10907.5
So, to try this, draw a normal line through the wall where the window is to be cut. Then intersect the line and all the wall components. In my model the only points that result are those where the normal intersects the faces of the solids, other models might have other points. Using the points that result, I think the approach is to use dropPoint() on each BRep and then get the face from the first element of the list that is returned, then process more or less as the script is currently written. I say I think only because I’ve not gotten it working yet, but I think I can.
One of the things that I take away from looking at the scripts you include with MoI is their simplicity and elegance: many are just bits of glue that tie the UI to the various factories. Thus when my script begins to get cumbersome and I’m fumbling around trying to accomplish something, I tend to question my approach. Is there a simpler way? Hence the idea of a “nearest neighbor” GeomObject method.
If such a method existed, I would imagine that it would find and return the lowest (most elemental) objects. In this case I would imagine that it would return the nearest face intersecting the vector & from there I could build up the list of faces via subsequent calls and then do the subset boolean difference. The idea struck me as one that might also be useful for other tasks where UI selection is inconvenient, and therefore a generalized tool that would benefit the script environment.
--Larry
Attachments:
Walls and windows.3dm
Show messages:
1-8
…
389-408
409-428
429-448
449-468
469-488
489-508
509-528
…
629-639