[NodeEditor] How i can Filet / Chamfer Points (corners) from a Rectangle Node ?
 1-9  10-29  30-39

Previous
Next
 From:  Michael Gibson
9666.10 
If someone wants to make a node for curve filleting, this is some script that will put fillets on sharp corners:

code:
function FilletCurve( crv )
{
	var factory = moi.command.createFactory( 'fillet' );

	var objs = moi.geometryDatabase.createObjectList();
	objs.addObject( crv );

	// Make a list with one boolean entry for each sharp corner in the curve. Right now this assumes all corners are sharp.
	var corners = moi.createList();
	var segs = crv.getSubObjects();
	for ( var i = 0; i < segs.length; ++i )
		corners.add( true );

	factory.setInput( 0, objs );       // Object list - objects to fillet
	factory.setInput( 1, false );      // True = do straight corners (for brep filleting only).
	factory.setInput( 2, corners );    // If filleting a single multi-segment curve, list of corners. true = fillet this corner.
	factory.setInput( 3, 1.0  );       // Fillet radius
	factory.setInput( 4, 'Circular' ); // Fillet shape, one of: 'Circular', 'ConstantDistance', 'G1', 'G2', 'G3'.
	factory.setInput( 5, 1.0 );        // Scale factor for G1-3 blend shapes.

	var res = factory.calculate();

	if ( res.length != 1 )
		return null;
	
	return res.item(0);
}


- Michael
  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:  Michael Gibson
9666.11 
And if someone wants to make a chamfer node, the fillet factory inputs are like this:


0: object list - Objects to fillet.
1: boolean - Straight corners, true = Do straight corners (only applies to brep filleting)
2: list of bool - Corners - If filleting a single multi-segment curve, list of corners true = fillet this corner.
3: number - Radius - Fillet radius or distance for ConstantDistance mode.
4: string - Shape, one of 'Circular', 'ConstantDistance', 'G1', 'G2', 'G3' .
5: number - Blend scale - Scale factor for G1-3 blend shapes.
For variable radius fillet, there can be additional inputs following consisting of a point list, radius number value, and string options group.


Chamfer factory has these inputs:


0: object list - Objects to fillet.
1: boolean - Straight corners, true = Do straight corners (only applies to brep filleting)
2: list of bool - Corners - If filleting a single multi-segment curve, list of corners true = fillet this corner.
3: number - Chamfer distance 1
4: number - Chamfer distance 2


- Michael
  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
9666.12 In reply to 9666.11 
Thank you Michael for the curve and chamfer information.

To further define fillet node and/or new chamfer node.
I had a look at Fillet node, (maybe Karsten made it?) under the construct2 menu, which has 269 lines, including about 30 commented out, and has the curve fillet factory input commented out.
The Fillet2 node under the r2d3 menu has only 47 lines, appears to have been derived from fillet node, and also has the curve fillet factory input commented out.
So these two nodes seem to be incomplete with regard to curves. One node for breps, another node for edges, no node yet for curves?

I think that a chamfer node or chamfer2 node can be created from the corresponding fillet or fillet2 nodes, once updated.
The coding must take quite a bit of effort.

- Brian
  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:  Smoluck
9666.13 
thanks everyone for your reply.

I ended up with a solution based on Pilou observation via a trim node and few other math nodes, but it still miss the Chamfer node as bemfarmer says.

Edit:
To create the same behavior as a Chamfer node, i used the Filet2 node in Continuity Mode: G2 and a Bulge at 0

EDITED: 31 Jan 2020 by SMOLUCK

  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:  Karsten (KMRQUS)
9666.14 
Hello,

under Curves2 is a curveFillet node. It takes 2 curves as input and gives the trimmed curves and the radius to the output. Making fillets for joined curves needs a more complex node - I'm not sure if it is possible or useful to integrate that in the existing node.

A nice day to all
Karsten
  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:  James (JFH)
9666.15 In reply to 9666.14 
Karsten,

It is good to hear from you; I hope you are well.

Regarding the curve filleting: The points that appear when applying "Fillet" UI tool to a selected polyline, are point objects, That is to say, the points appear in the "Types" Menu of Scene Browser.

This is not the case with points displayed when applying "ShowPts" to the same polyline.
AFAIK, being point objects should mean that they are addressable to NE (unlike ShowPts artefacts).

In my node wishlist proposal: http://moi3d.com/forum/index.php?webtag=MOI&msg=9581.145 I suggested that all points be selected and the "Radi" input accept a numArray, so that each corner would be rounded by the corresponding radius to number in numArray.

Perhaps the Fillet factory does not have this multi-processing capability. If the node can only accept a single number input radius, it should nevertheless be able to be applied to a pattern selection of points, much like as in my node wishlist proposal: http://moi3d.com/forum/index.php?webtag=MOI&msg=9581.142

Although, I think it would be best if the selection and split operations of points to be coded within the "Fillet"node itself, but to make the procedure explicit I have shown them here as precursors nodes.

James
https://www.instagram.com/nodeology/

EDITED: 3 Feb 2020 by JFH

Attachments:

  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
9666.16 In reply to 9666.15 
James, I like your suggestions.

I spent a couple of hours trying to modify curveFillet, using Michaels code, but the crvFillet.js would not work.

Here is a (non-functional) crvFillet.js node, (to be placed in the nodeeditor extensions folder, which adds a node to curves2 menu.

I did not try yet to implement the sel (selection) mask input.
I have confusion between Michael's objs, crv, and c1...

- Brian

EDITED: 8 Feb 2020 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
Next
 From:  James (JFH)
9666.17 In reply to 9666.16 
Brian,

It's a good start!

Rather than extracting points from the profile, Michael's fillet.js code does this automatically. Is there a way of selecting by index from this point object list; effectively similar to manual selection ("pointPicker")?

Boolean (1s & 0s) input for pattern selection would be better, but index selection may be easier. and a good first step.

I know that none of this is not easy!
Thanks for your efforts.

James
https://www.instagram.com/nodeology/


EDITED: 4 Feb 2020 by JFH

Attachments:

  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
9666.18 In reply to 9666.17 
After many mistakes, here is another test version of crvFillet for curves that actually works.
It uses Karsten's code modified, with Michaels fillet/Chamfer code.

Nothing has been done for a point selection mask or boolean yet.
It is just a test version, with very limited testing.

I figure that a Chamfer version would be very similar...
My programming play time is limited by too many other projects, and too little quality clear thinking time:-)

- Brian

p.s., place crvFillet.js in the Extensions folder of nodeeditor. (I use the AppData structure)
The test node will show up in the Curves2 menu.

EDITED: 8 Feb 2020 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
Next
 From:  bemfarmer
9666.19 In reply to 9666.18 
For the 6 people who downloaded older version, cleaned up code, and restored fillet type, radius adjust, previous post.

What is the content of the corners list of Michaels code? corners.add( true );
How does the "true" fit in.
Is corners a list of corner points, with a different method of true (do fillet)?, or false (do not fillet this corner)?

Would masking the corners list entail going through the corner list one by one and applying boolean 1 to place the point in a corners2 list, or boolean 0 to not keep the point?

- B

EDITED: 8 Feb 2020 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
Next
 From:  Michael Gibson
9666.20 In reply to 9666.19 
Hi Brian,

> What is the content of the corners list of Michaels code? corners.add( true );
> How does the "true" fit in.

It's a list of boolean (true/false) values, it needs to have one entry for each corner and value of true means that corner will be filleted and false means it won't be filleted.

The part that's a little tricky is making the list the right length so that it has one entry in it for each possible fillet location. I've put in a .numVertices property on the fillet factory for the next beta release to make it easier to know how many entries should be in that boolean list.

- Michael
  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
9666.21 In reply to 9666.20 
Hi Michael,
Thank you for the explanations, and the forthcoming new method, which I assume will reveal the number of vertices. Also wondering about the generateVertices() code/ what it does, in Fillet.js?
- Brian

EDITED: 8 Feb 2020 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
Next
 From:  Michael Gibson
9666.22 In reply to 9666.21 
Hi Brian, the factory.generateVertices() call in Fillet.js calls a function on the fillet factory that creates point objects and puts them in the geometry database.

That's done in the regular fillet command because it has a selection step where it waits for the user to select those points and when that selection step is done it then builds the boolean list with a value of true set if that point object was selected.

Also I was previously thinking that the boolean list needed to have one entry for each sharp corner in the curve. But that's not correct, it actually needs to have one entry for each segment of the curve. A value of true will mean to put a fillet at the start of that segment, but it will only do anything if the start of the segment is a sharp point.

So the previous code that makes the list by calling .getSubObjects() on the curve to get all of its segments should be fine, you won't actually need the new .numVertices property after all.

Let me know if any of this isn't clear.

- Michael
  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:  Psygorn (DRILLBIT)
9666.23 In reply to 9666.12 
Hello all,

Where can I find Chamfer2.nod ?
  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:  James (JFH)
9666.24 In reply to 9666.23 
Psygorn (DRILLBIT)

Use 3 line menu symbol in top left title bar to locate difficult-to-find nodes. See image attached.
Chamfer2.node is somewhat bizarrely in WidgetSample menu.

I will one day do a rationalisation of node menus, but probably not for awhile
as I don't have the time right now or in the near future.

James
https://www.instagram.com/nodeology/

EDITED: 14 Mar 2022 by JFH

Image Attachments:
Size: 44.1 KB, Downloaded: 26 times, Dimensions: 640x320px
  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:  Barry-H
9666.25 
Hi ,
is there a circular array node with an angle constraint as Moi version.
Also I don't have the chamfer node in my extensions so can somebody post it please.
I think a node for notes would be a good idea to give some reference rather than adding a separate text file.
Cheers
Barry
  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)
9666.26 In reply to 9666.25 
If a radial array node is not yet existing, i believe that you can make your own with the classical existing nodes!
  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
9666.27 In reply to 9666.25 
Hi Barry,

Here is the forum topic regarding Fillet and Chamfer, from two years ago.
It has Michaels description of the elements of the Fillet and Chamfer factories... which is
the information needed to do a Chamfer node...

https://moi3d.com/forum/index.php?webtag=MOI&msg=9666.1

I do not know if anyone ever made a working Chamfer node.
Nor how the surface, edges, brep, etc factor in.

I have a folder with the little bit of study that I did 2 years ago.

- Brian

Here is the Chamfer2 that I did 2 years ago. Either it does not work, or needs the proper brep (?) input?
I think it was just a very quick modification of Fillet2 node.
Orange means something is wrong/ mismatched outputs and inputs.
Maybe crvChamfer is needed?
There must be 5 versions of Fillet?

image host

I have no more play time, so am dropping this for now.

Edit, Deleted Chamfer2. Replaced with Chamfer3, down a few posts.

EDITED: 16 Mar 2022 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
Next
 From:  Barry-H
9666.28 In reply to 9666.27 
Hi Brian,
thanks for posting the Chamfer 2 node but as you say its not functioning.
I had found Michaels post but not in my skill set to implement it,
I'm managing to work around without a chamfer node at the moment.
Have you any ideas how to make a notes node.
I use the Const node title at the moment but your restricted to a single line.
Many thanks
Barry
  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:  Barry-H
9666.29 In reply to 9666.26 
Hi Pilou,
yes I have managed to create the circular array with existing nodes but it required doing a full 360 array and then using index select.
I could possible use mpatharray but the orientation of the shapes must align to centre.
Cheers
Barry
  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

 

 
Show messages:  1-9  10-29  30-39