pymel.core.modeling.curveIntersect

curveIntersect(*args, **kwargs)

You must specify two curves to intersect. This command either returns the parameter values at which the given pair of curves intersect, or returns a dependency node that provides the intersection information. If you want to find the intersection of the curves in a specific direction you must use BOTH the “-useDirection” flag and the “direction” flag.

Flags:
Long name (short name) Argument Types Properties
caching (cch) bool  
   
constructionHistory (ch) bool ../../../_images/create.gif
 
Turn the construction history on or off
direction (d) float, float, float ../../../_images/query.gif ../../../_images/edit.gif
 
The direction that the input curves are projected in before intersecting. This vector is only used if “useDirection” flag is true.
directionX (dx) float  
   
directionY (dy) float  
   
directionZ (dz) float  
   
nodeState (nds) int  
   
tolerance (tol) float ../../../_images/query.gif ../../../_images/edit.gif
 

The tolerance that the intersection is calculated with. For example, given two curves end-to-end, the ends must be within tolerance for an intersection to be returned.Default:0.001Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

useDirection (ud) bool ../../../_images/query.gif ../../../_images/edit.gif
 

If true, use direction flag. The input curves are first projected in a specified direction and then intersected. If false, this command will only find true 3D intersections.Default:false

Derived from mel command maya.cmds.curveIntersect

Example:

import pymel.core as pm

import maya.cmds as cmds

pm.curveIntersect( 'curve1', 'curve2' )
# Returns the parameter values that the curves intersect at.
# eg. if 6 parameter values are returned, the first 3 are
# on curve1 and the last 3 are on curve2.


pm.curveIntersect( 'curve1', 'curve2', useDirection=True, direction=(0, 1, 0) )
# Returns the parameter values that the curves intersect at
# when projected along vector (0, 1, 0).  This is useful
# for example when you are viewing the two curves in an orthographic
# view and the curves appear to intersect, even though
# they do not intersect in 3D.

node = pm.curveIntersect('curve1', 'curve2', ch= True)
p1 = pm.getAttr(node + ".parameter1" )   # or use ".p1"
p2 = pm.getAttr(node + ".parameter2" )   # or use ".p2"
# Returns a string which is the name of a new curveIntersect
# dependency node.
# The "getAttr" commands return the parameter values at
# which the curves intersect each other.

Previous topic

pymel.core.modeling.curve

Next topic

pymel.core.modeling.curveOnSurface

Core

Core Modules

Other Modules

This Page