extract information regarding an object (Details)
All  1-5  6-8

Previous
Next
 From:  hadri1
12081.6 
Hi everyone,

By 'corner point,' I mean a point that behaves the same way as the start and end points of a curve.
Meaning that it is actually "on the curve" and when i move it, the transition on each side is not smooth anymore.



when having a look at the object properties : i do not see a way to identify a curve with additional corner points.
the properties indicates 8 edit points but, there is actually 5 control points and 3 corners points (start point, end point and the one i added).



when i want to get rid of extra corner point, i usually run the fillet command.
unluckily, the fillet commande script is not the easiest for me to understand.

Hadri1

  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
12081.7 In reply to 12081.6 
Hi hadri1,

For the case that you showed:



You can detect 3 corner points by this method:

code:
function CountCornerPoints( crv )
{
	var num_corners = 0;

	/* Count 1 for each segment after the first segment. */

	var segment_list = crv.getSubObjects();
	var num_segments = segment_list.length;

	num_corners += (num_segments - 1);

	if ( !crv.isClosed )
	{
		/* If the curve is open add one for start point and one for end point. */
		num_corners += 2;
	}
	else
	{
		/* If the curve is closed add one if it is sharp at the start/end seam point. */
		var seg = segment_list.item(0);
		if ( !seg.getIsG1ToAdjacentSegment(0) )
		{
			num_corners++;
		}
	}

	return num_corners;
}


- 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
 From:  Zooen
12081.8 In reply to 12081.6 
Hi hadri1,
That’s because you’re selecting the curve and the points at the same time. If you only select the curve, you’ll see other information, including the segments.
The end points are not corner points, which makes sense to me. Furthermore, if, for a selected curve, the Properties panel shows you 2 segments (even if you can’t see them visually), this indicates that you have 1 corner point on your curve.

I’m adding a curve with 3 segments, so 2 corner points (and 2 end points that are not corner points).

- Zooen

EDITED: 24 Aug 8:13 by ZOOEN

Image Attachments:
Size: 358.8 KB, Downloaded: 7 times, Dimensions: 2560x1437px
Size: 392.8 KB, Downloaded: 7 times, Dimensions: 2560x1437px
Size: 375.8 KB, Downloaded: 8 times, Dimensions: 2560x1437px
  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: All  1-5  6-8