node editor: questions

Next
 From:  NaN
11068.1 
I am playing around with the node editor atm. Great tool! Will probably have more than one question :) In order not to spam the forum with threads I'll just post upcoming questions in this one if that's ok. First question would be:

Expand point constant
===================

Have used nkallen's extension to automatically record the things I click in the UI as node graph - which works nicely.
Initially I was wondering how these generated line nodes know their coordinates - until I found out that there is an "expand point constant" menu entry in the right click menu of the start and end input nodes of a line. Ok!
Now I tried the same with a polyline. Apparently I only get one "Const Point" object though - how is the entire list of points that define this polyline stored? And how can I change these points again?

As soon as I edit some coordinate in that one "Const Point" node that appears after clicking "expant point constant" in the case of a polyline, the auto-generated geometry disappears.
When deleting the "Const Point" node, the polyline reappears. So the initial constants stlll seem to be saved in the polyline (and also line) nodes? (How) could I change these inherent constants?

EDITED: 18 Apr 2023 by NAN


  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)
11068.2 
Don't forget that this "Node recorder" was just a draft By Nick Fallen before he starts the code of it's own Nurb prog! ;)

So you will found numerous missing parts or subjects!

But that is better than nothing! :)

EDITED: 18 Apr 2023 by PILOU

  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:  NaN
11068.3 In reply to 11068.2 
Ah, ok. Just a/b comparing with the node editor version from James. Here the "expand point constant" stuff doesn't seem to be present, so this is part of Nick's extension already.
Okok, one can still learn a lot by seeing how Nick's editor would create a graph. And then I can redo it in the "official" James version! Fortunately these two run neatly side-by-side.
  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:  NaN
11068.4 
Objects as input to macros
======================

Is it possible to have e.g. a Point or a Vector as input for a macro - and can I split this input into the individual x, y, z components then?
So if I want a construction plane as input for a macro that constructs a sketch, could I have the point "position" and the vector "normal" as inputs or would I need pos_x, pos_y, pos_z, normal_x, normal_y, normal_z?
  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
11068.5 In reply to 11068.4 
Hi NaN

As there has been no response so far, I will take a try.

Firstly, I do not understand your question. Can you provide an example of what your are trying to do, but do it in a regular node canvas, not the Macro canvas?

Secondly, I recollect that Max used the "same" type of node programming for the Macros as is used in the original nodes node canvas.
I think that all of the nodes that can be utilized in a node canvas, can also be utilized in a macro canvas (???)
So are there things that can be done in a node, but not in a macro???
(The macro "input" and "output" tags cannot be used in the regular node canvas.)

A macro canvas CAN contain sub level macro canvas(es).

- Brian
I am very rusty on the nodeeditor.

EDITED: 19 Apr 2023 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
 From:  NaN
11068.6 In reply to 11068.5 

Hi, thanks for having a look!

Not on my Moi-machine atm but I can try to explain what I mean:
I am evaluating how viable it is to use the node editor to build a design that is made from several parts.
I am thinking about such a structure:

my_assembly // root level outside of any macros
--part1(part1_origin, part1_normal, ....)
----s1 = sketch(origin1, normal1, heavily_shape_affecting_parameter1, width1,height1,...)
----s2 = sketch(origin2, normal2, heavily_shape_affecting_parameter2, width2, height2,...)
----loft(s1, s2)
----...
--part2(part2_origin, part2_normal)
----....

part1, part2 and sketch would be macros. part1 and part2 are mainly components to make the (root) assembly level easier to understand (instead of having all nodes at the root level).
And in the case of sketch I am actually using several differently parameterized instances of the same macro that are then lofted to form the part.
In all these cases I don't want to hardcode the later position into the nodes but try to formulate the positions as easy as possible (relative to the xy plane) - and then provide a "workplane" as input that is based on an origin and a normal - and the macro is transforming itself accordingly.

Now the root of my question is: Would I have to define the inputs for the workplane with primitive float types as origin_x, origin_y, origin_z, normal_x, normal_y, normal_z.
Or is it possible to accept an object as a macroin. So I just have origin, normal - and then some node that is decomposing these inputs into the x,y,z elements inside the macro.
There are several native nodes that accept Point or Vector inputs. Not sure whether I can do the same with my own macros though. (On first try I cannot connect a macroin socket with the input socket of a node that expects a Point).

Not sure yet how efficient it is to do this in the node editor. Textual scripts probably are faster written and offer more structuring possibilities. But trying it with the node editor is an interesting challenge :)
The reason why I do this with "code cad" (scripting or nodes) is that the sketches are highly parametric - the shape can substantially change depending on some of it's parameters. And I know that I will need several versions of the design with different parameters - and there are several uncertainties that I have to evaluate with prototypes. So my (perhaps naive) assumption is that this should best be highly parametric and essentially best be generated by a program.

I have made a first prototype with an open source, Python, OCCT based code cad. This works generally well, but there are some holes in the exported STEP model. I haven't found a way around these yet (other than importing the STEP into a program like MoI and manually fixing them - which has to be redone at each iteration...) So wanted to try out another program that isn't based on OCCT to see whether that helps (or whether it's just me making the same or different mistakes in any program I get my hands on :) )

EDITED: 20 Apr 2023 by NAN

  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