Quinconce Final Presentation

36
CAD LOGIC SS 08/09 Slitting / documentation AA’ : Alice + Alec’

description

Quinconce Final Presentation

Transcript of Quinconce Final Presentation

Page 1: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation

AA’ : Alice + Alec’

Page 2: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

I) ExplorationPre-Phase

Page 3: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Ce

nte

r o

f th

e c

ut

Le

ng

ht

of

the

cu

t

Slit #010 Slit #011 Slit #012

Slit #013 Slit #014 Slit #015

Slit #016 Slit #017 Slit #018

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Center of the cut Lenght of the cut

Slit

#010

Slit

#011

Slit

#012

Slit

#013

Slit

#014

Slit

#015

Slit

#016

Slit

#017

Slit

#018

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Variations/Declination

Nb

of

cu

tsS

ha

pe

, p

ositio

n,

ce

nte

r o

f th

e c

ut

Slit #001 Slit #002 Slit #003

Slit #004 Slit #005 Slit #006

Slit #007 Slit #008 Slit #009

Variations/D

eclin

ation

Nb of cuts Shape, position, center of the cut

Slit

#001

Slit

#002

Slit

#003

Slit

#004

Slit

#005

Slit

#006

Slit

#007

Slit

#008

Slit

#009

Center of the cutLenght of the cut

Slit #

010

Slit #

011

Slit #

012

Slit #

013

Slit #

014

Slit #

015

Slit #

016

Slit #

017

Slit #

018

Circle - 20 slits Circle - 40 slits Elipse - 80 Slits Elipse - 80 Slits - offset centre (1)

Elipse - 80 Slits - offset centre (2)

Elipse - 80 Slits - offset centre (3)

Leaf shape - 80 Slits Elipse - 80 Slits - linear centre

Random length (1) - 40 Slits

Random length (2) - 40 Slits

Elipse (1/4) - 20 Slits

Phase 1 - Slit AThis series of slitting experiment demonstrates the quality of fuzziness and unexpected chaotic condition by stretching or banding the paper with slits converging to a points; whereas the structural behavior of the paper itself is apparently weakened by the slits

Page 4: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Phase 1 - Slit BiApart from Slit A, Slit B is the first attempt to explore this specific way of shifting slits. Comparatively, Slit B series has more parameters to control the final result which allows for wider varieties. The Slitting does not weaken so much the structural property of the paper but still being very stretchable, contractable and flexible.

HYBRID 1slit 5 - 35mm (gradual)interval 2.5/5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_linear slit & wavy interval

HYBRID 2slit (gradual)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

HYBRID 3slit (gradual)interval (gradual)gap (gradual)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_curvy radial slit and interval

Page 5: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Phase II - Slit Biia & iv This series of slitting experiment creates just slight or no degree of deformation to the paper. This proves that the radial pattern is not suitable for slitting method

Page 6: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

HYBRID 5slit (gradual)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & interval

Phase II - Slit Biii

Page 7: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Phase II - Slit Biib & ivThis series of slitting experiment creates spatial volume easily, but rather too centre-oriented. It becomes more interesting when pushing force is not parallel to the normal of the material plane. Ellipse shape may also help to break the symmetry.

CIRCULAR 1slit (gradual)interval (gradual)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

Page 8: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

CIRCULAR 2slit (gradual)interval (gradual)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_rectangular slit & radial interval

Page 9: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

COMBINED 3slit (gradual)interval (gradual)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

Page 10: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

COMBINED 2slit (gradual)interval (gradual)gap 5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_rectangular slit & radial interval

Page 11: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

SLIT A. Slits converging toward a point

Potentials- fuzzy e�ect- unexpected / unpredictable quality

Parameter- length of slits (constant : gradual)- location of centre (centred, o�set, at the edge, out of the edge)- density of slits

Variable Factor- application of stress (direction)

SLIT B. Slits in alternate interval i. linear iia. radial - linear form iib. radial - circular form iv. hybrid iii. combined

Potentials- stretchable curvilinear surface - full of varieties

Parameter- length of slits (constant : gradual)- length of intervals (constant : gradual)- width of gap in between 2 lines of slits (constant)- ratio of length of slit to length of interval- ratio of length of slit to width of gap- location of centre- density of slits- pattern of slits in relation to pattern of intervals

Variable factor- application of stress (direction)

PHASE I - Slit A

SURFACE DEFORMATION

Material Properties - with certain sti�ness

CIRCLE 120 Slitsconstant length

CIRCLE 240 Slitsconstant length

CIRCLE 380 Slitsconstant length

ELIPSE 180 Slitscentred centregradual change of length

ELIPSE 280 Slitso�set centregradual change of length

ELIPSE 3 (1)30 Slitscentre at the edgegradual change of length

ELIPSE 3 (2)30 Slitscentre at the edgegradual change of length

ELIPSE 3 (3)40 Slitscentre at the edgegradual change of length

ELIPSE 418 Slitscentre out of the edgegradual change of length

Star 140 Slitscentred centrerandom length

STAR 240 Slitscentre at the edgeboth gradual and random change of length

Star 380 Slitso�set centreboth gradual and random change of length

LINEAR 1slit 10mm (constant)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval 2ratio of slit to gap 4pattern_regular linear

LINEAR 2slit 20mm (constant)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval 4ratio of slit to gap 8pattern_regular linear

LINEAR 3slit 30 mm (constant)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval 6ratio of slit to gap 12pattern_regular linear

LINEAR 4slit 5 - 35mm (gradual)interval 2.5/5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_chaning linear

HYBRID 4 slit (gradual)interval 2.5mm (constant)gap (gradual)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_linear to curve slit & regular linear interval

LEAF 180 Slitso�set centregradual change of length

ELIPSE 6 (1/4) 20 Slitscentre at the edge of the materialgradual change of length

ELIPSE 580 Slitslinear centregradual change of length

PHASE I - Slit Bi

PHASE II - Slit Biia & iv PHASE II - Slit Biib & iv

HYBRID 1slit 5 - 35mm (gradual)interval 2.5/5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_linear slit & wavy interval

HYBRID 2slit (gradual)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

HYBRID 3slit (gradual)interval (gradual)gap (gradual)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_curvy radial slit and interval

CIRCULAR 3slit (gradual)interval (gradual)gap (gradual)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

HYBRID 5slit (gradual)interval 5mm (constant)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & interval

CIRCULAR 1slit (gradual)interval (gradual)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

CIRCULAR 2slit (gradual)interval (gradual)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_rectangular slit & radial interval

COMBINED 2slit (gradual)interval (gradual)gap 5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_rectangular slit & radial interval

COMBINED 3slit (gradual)interval (gradual)gap 2.5mm (constant)ratio of slit to interval (varied)ratio of slit to gap (varied)pattern_circular slit & radial interval

COMBINED 1slit 15mm (constant)interval 10mm (constant)gap (gradual)ratio of slit to interval 1.5ratio of slit to gap (varied)pattern_radial slit & circular interval

PHASE I - Slit Biii

Apart from Slit A, Slit Bi is the �rst attempt to explore this speci�c way of slitting in every alternative interval. Comparatively, Slit B series has more parameters to control the �nal result which allows for wider varieties. The slitting doesn’t weaken so much the structural property of the paper but still being very stretchable, contractable and �exible

*transformable*contractable*stretchable*�exible

CAD_LogicDD : Alice & Alec’summary of investigation

This series of slitting experiment demonstrates the quality of fuzziness and unexpected chaotic condition my stretching or banding the paper with slits converging to a points; whereas the structural behavior of the paper itself is apparently weakened by the slits

This series of slitting experiment creates just slight or no degree of deformation to the paper. This proves that the radial pattern is not suitable for slitting in alternate interval

This series of slitting experiment creates spatial volume easily, but rather too central oriented. It becomes more interesting when pushing force is not parallel to the normal of the mate-rial plane. Ellipse shape may help to break the symmetry.

Page 12: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

PHASE I - Slit A

PHASE I - Slit Bi

PHASE II - Slit Biia & iv PHASE II - Slit Biib & iv

PHASE I - Slit Biii

Apart from Slit A, Slit Bi is the �rst attempt to explore this speci�c way of slitting in every alternative interval. Comparatively, Slit B series has more parameters to control the �nal result which allows for wider varieties. The slitting doesn’t weaken so much the structural property of the paper but still being very stretchable, contractable and �exible

This series of slitting experiment demonstrates the quality of fuzziness and unexpected chaotic condition my stretching or banding the paper with slits converging to a points; whereas the structural behavior of the paper itself is apparently weakened by the slits

This series of slitting experiment creates spatial volume easily, but rather too central oriented. It becomes more interesting when pushing force is not parallel to the normal of the mate-rial plane. Ellipse shape may help to break the symmetry.

SURFACE DEFORMATION *transformable*contractable*stretchable*�exible

CAD_LogicDD : Alice & Alec’summary of investigation

Page 13: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

II) Analysis of the model translated into the digital realm

Through previous experiments, we focus at the end on this type of shifted straight cuts. We obverse that it could be adjusted by numerous param-eters, including length of slits, density of slits, pattern of slits and variable factors - magnitude and direction of applied forces. Therefore, the slitting method creates an intricate network which is flexible enough that, from time to time, even one single pattern can always result into series of forms and shapes.

In order to analyze the basic deformation princple of the slitting itself, we zoom in and look at the typical condition before/after stretch. Interestingly enough, we find that the shifted slits induce a series of nodes which are linked to 4 other nodes. A surface is transformed into a quadrilateral lattice network. [Quinconce], a french word, describes exactly the geometric relationship consisting of five points, four of them forming a square or rectangle and a fifth at its center.

[Quinconce]

Page 14: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

before stretch / series of typical slits

Page 15: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

before stretch / series of nodes in between the slits

Page 16: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

before stretch / each node has 4 Linkages which form a Quinconce quadilateral lattice network

L

Page 17: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

after stretch / location of the nodes are displaced, but length of the linkages remains constant

elongated

shortened

L

Page 18: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

III) Strategy of the digital model

Strategy 2 : New-form SearchingWe turn our direction to see how we can demonstrate the behavior of a surface by perceiving it as a Quinconce lattice network in a digital format. By scripting, we can easily set up parameters for making different lattice network. Then, we can test out various possibilities on one single pattern. In this way, instead of simply translating any of our physical models into digital realm in a represenatational way, we actually create a flexible lattice system which can be manipulated by adjusting various parameters in order to come up with a new desirable form, meanwhile there is a conherent logic behind the form that could be manufactured by using 2D material. In another word, it is a back-and-froth design process.

In general, there are two possibilities for the strategy of our digital model, “manufacture-oriented” & “new form searching”

Strategy 1 : Manufacture-orientedAssuming there is a piece of object with 3D curvilinear surface and how we can use the same slitting prinicple and “reproduce” a slitting pattern on a 2D surface. Therefore, one can easily apply the technique to many different objects and generate 2D pattern for manufacturing. However, in this case, a key characteristic of our slitting method is being ignored - Flexibility of the intricate lattice network. In our analysis of the basic principle, we have explained that the relationship between the slitting pattern and deformation result is not 1 to 1 linear process because of many parameters and the variable factor - applied force. For any pattern applying the same principle, owning to the magitude and direction of the applied force, the paper will deform into different shapes. Without accurate mathematical calculation and take all the factors into account, it is not possible to reverse the process from 3D to 2D. Over simpfying or ignoring some factors would take away the complexity of the slitting method.

Page 19: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

IV) Explanation of the script and logic

mathematical

Step 1 create primary nodes (black) & secondary nodes (grey),base on a certain slitting pattern

Step 2attach spheres to the centre of each nodes which link up the 4 surrounding points. The spheres repre-sent tracks for linked surrounding nodes

Step 3build up the connections for visualizing the network. The length of the connections should always remain constant

The critical part of the principle of the deformation is that displacement of the nodes in any direction would not affect length of the linkage. Therefore, when we develop our script, we imagine a sphere, which represents the track for the linked surrounding nodes, is attached on to the centre of each node. When one node, N0, is moved, let say from original position to a new position, nP0, surrounding nodes will follow. Without other circumstances, we take the assumption that the surrounding nodes will be displaced by the shortest distance. If we create the curve linking the original position of a surrounding node to nP0. Then, we can locate the new position of the surrounding node as the intersection point of the curve and the sphere of the node N0.

Diagram illustrates the logic of the script / before deformation

Page 20: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

mathematical

When deformation occurs and a node is moved in z direction, other nodes will follow and move to the new positions base on the logic that length of linkage remains constant all the time.

Section view

A row of nodes on 2D plane before deformation

Diagram illustrates the logic of the script / during deformation

Page 21: Quinconce Final Presentation
Page 22: Quinconce Final Presentation
Page 23: Quinconce Final Presentation
Page 24: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

V) Finished script and images of the digital model

At this moment, the finished script allows us to test out simple and even slitting patterns. We can choose to move any node to different directions and execute the deformation. Since this is an ab-stract model which using quinconce lattice network as a basic principle for deformation and some physical properties of material have to be excluded, therefore the performance of the deformation done by the script is still is not a real simulation. Nevertheless, given more time, the script can be further enhanced and be more comprehensive, so that we can test with more complex patterns, e.g. different lengths and densities of slits, with the same slitting principle.

Step 1 [Create Surface with U>=V]define the numbers of divisions in X and Y axis;and setup the basic grid for locating the the primary nodes

For demonstration, we use a basic 50 X 10 grid

Page 25: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Step 2 [Init Scene()]create the lattice network composed of primary nodes and secondary nodes marked by locators

Page 26: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Step 3 [Choose Locator to offset]select desired locator(s) to be moved; they will be the control nodes for deforma-tion

For demonstration, we select the middle node of the grid

Page 27: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Step 4 [Calculate Distances]taking selected locators as reference, calcula-tion of the distances among the nodes will be done

Page 28: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Step 5before moving the selected locators, there are options to continue; to change parameter or to use default parameter setting

Page 29: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Step 6 [Execute Quinconce Function()]a new dialogue box will appear for adjusting the distances for moving each selected loca-tors in x, y, z directions

Step 7 [Execute Wireframe Function()]an extensive option is to build a wireframe on the quinconce network to visualize the actual slitting pattern. However, the result is not properly resolved yet.

Page 30: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

Other trialsIn order to experiment with the digital model, we tested out different push and pull on the same slitting pattern. On one hand, the script is very successful in deforming a surface base of the quin-conce logic and all the linkages between nodes remain constant before/after. On the other hand, when there are more than one nodes being moved, the distance calculation among the nodes becomes very complicated for the redisturbution of all the nodes. Unavoidably errors may happen.

Page 31: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

import maya.cmds as cmds

# Function to lauch the windowdef initparameters(): # Create a scene with the default parameters # udiv = vdiv = 3, pointtooffsept = SecondPoint_4 def defaultparam(*arg): cmds.select(all=True) cmds.delete() createSurface() cmds.showHidden(‘surface’) initscene() if cmds.objExists(“SecondPoint_4”): cmds.select(“SecondPoint_4”) controlepoints() # Create the first surface def createSurface(udiv=3, vdiv=3): if cmds.objExists(‘surface’): cmds.delete(“surface”) surface = cmds.polyPlane(ax=(0,0,1), w=50,h=50, sx=int(vdiv), sy=int(vdiv), n=”surface”) # Add attributes to the surface cmds.select(“surface”) cmds.addAttr(ln=”udivision”, dt=”double2”, keyable=1, w=1) cmds.setAttr(“surface.udivision”, 3, 3, type=”double2”) cmds.addAttr(ln=”vdivision”, dt=”double2”, keyable=1, w=1) cmds.setAttr(“surface.vdivision”, 3, 3, type=”double2”) # Change the number of udiv.& vdiv def changeDiv(*args): udiv = cmds.getAttr(“surface.udivision”) vdiv = cmds.getAttr(“surface.vdivision”) if cmds.objExists(‘surface’): cmds.delete(“surface”) surface = cmds.polyPlane(ax=(0,0,1), w=50,h=50, sx=udiv, sy=vdiv, n=”surface”) # Add attributes to the surface cmds.select(“surface”) cmds.addAttr(ln=”udivision”, dt=”double2”, keyable=1, w=1)

cmds.setAttr(“surface.udivision”, udiv, udiv, type=”double2”) cmds.addAttr(ln=”vdivision”, dt=”double2”, keyable=1, w=1) cmds.setAttr(“surface.vdivision”, vdiv, vdiv, type=”double2”) # Hide the surface to choose the controle points = pressure points def ChoosePoints(*args): cmds.hide(‘surface’) # Second Window ::: Adjust Forces ::: def tocontinue(*args): forces = cmds.window(title=”Adjust Forces”, width=600, height=400) cmds.columnLayout( adjustableColumn=True ) cmds.button(“movelocator”, label=’Move Locator’) nbpoints = cmds.getAttr(‘surface.nbpoints’) Pointtooffset = [] loc = [] for i in range (int(nbpoints)): point = cmds.getAttr(‘surface.pointtooffset%s’ %i) loc.append(point) # Create a first slider to control all the locator position ::: Doesn’t works yet. :-) Offx = cmds.floatSliderButtonGrp(‘Offx’, label=’Uniform X Offset’, field=True, min=-50, max=50, v=0) Offy = cmds.floatSliderButtonGrp(‘Offy’, label=’Uniform Y Offset’, field=True, min=-50, max=50, v=0) Offz = cmds.floatSliderButtonGrp(‘Offz’, label=’Uniform Z Offset’, field=True, min=-50, max=50, v=0) for i in range(int(nbpoints)): cmds.connectControl(‘Offx’, “%s.translateX” %loc[i]) cmds.connectControl(‘Offy’, “%s.translateY” %loc[i]) cmds.connectControl(‘Offz’, “%s.translateZ” %loc[i]) # Create a slider for each other locator for i in range(int(nbpoints)): offx = cmds.floatSliderButtonGrp(‘offx%s’%i, label=’Offset X_%s’ %i, field=True, min=-50, max=50, v=0) cmds.connectControl(‘offx%s’%i, “%s.translateX” %loc[i]) offy = cmds.floatSliderButtonGrp(‘offy%s’%i, label=’Offset Y_%s’ %i, field=True, min=-50, max=50, v=0) cmds.connectControl(‘offy%s’%i, “%s.translateY” %loc[i]) offz = cmds.floatSliderButtonGrp(‘offz%s’%i, label=’Offset Z_%s’ %i, field=True, min=-50, max=50, v=0) cmds.connectControl(‘offz%s’%i, “%s.translateZ” %loc[i])

Full Script

Page 32: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

cmds.button(“Quinconce”, label=’Execute Quinconce Function()’, command=Quinconce ) cmds.button(“Wireframe”, label=’Execute Wireframe Function()’, command=makeWireframe ) cmds.showWindow(forces) # Re-Set the parameters def back(*arg): cmds.select(all=True) cmds.delete() initparameters() # Make a wireframe to simulate the paper stripes def makeWireframe(*arg):

cmds.select(“surface”) numFaces= cmds.polyEvaluate(face=True) w = cmds.getAttr(“surface.vdivision”) w = 50/(w[0][1]*4) #loop through all the faces of the objects and extrude one by one for i in range(0, numFaces, 1): currentFace=”%s.f[%d]” % (“surface”,i) cmds.polyExtrudeFacet(currentFace,offset=w) #cmds.refresh() #delete all the original faces of the objects allOriginalFaces= “%s.f[0:%d]” % (“surface”,numFaces-1) cmds.polyDelFacet(allOriginalFaces) # Give a thickness to the paper #newNumFaces= cmds.polyEvaluate(face=True) #allNewFaces= “%s.f[0:%d]” % (“surface”, newNumFaces-1) #cmds.polyExtrudeFacet(allNewFaces,kft=True) # Create the first window ::: Adjust Surface Parameters ::: createSurface() cmds.hide(‘surface’) param = cmds.window(title=”Adjust Surface Parameters”, width=600, height=400) cmds.columnLayout( adjustableColumn=True ) cmds.button(label=’’, en=False , bgc=[225,0,0]) cmds.button(“surface”, label=’Create Surface with U >= V’, en=False)

udiv = cmds.floatSliderButtonGrp(‘udiv’, label=’Nb of U Divisions’, field=True, min=1, max=100, v=0, s=1.0, pre=0 ) vdiv = cmds.floatSliderButtonGrp(‘vdiv’, label=’Nb of V Divisions’, field=True, min=2, max=300, v=0, s=1.0, pre=0 ) cmds.connectControl(‘udiv’, “surface.udivision”) cmds.connectControl(‘vdiv’, “surface.vdivision”) cmds.button(“div”, label=’Press Here to Create the Surface’, command=changeDiv ) cmds.button(“init”, label=’Init Scene()’, command=initscene ) cmds.button(label=’Choose Locator to offset’, command=ChoosePoints ) cmds.button(label=’Calculate Distances’, command=controlepoints ) cmds.button(label=’’, en=False, bgc=[225,0,0]) cmds.button(label=’### next ###’, en=False) cmds.button(label=’To Continue’, command=tocontinue ) cmds.button(label=’Change Parameters before to continue’, command=back ) cmds.button(label=’Use Default Parameters’, command=defaultparam ) cmds.showWindow(param)

# Initialize the scene # Step 01: Get the Primary Points = The vertices of the surface.# Step 02: Get the Secondary Points = Vertices of the surface after a subdivision# Step 03: Delete the non-cuts edges! def initscene(*args): # Clean Scene cmds.select(all=True) if cmds.objExists(‘surface’): cmds.select(“surface”, d=True) cmds.delete() # Create groupe to store the locators cmds.group(n=’PrimPoints’, em=1) cmds.group(n=’SecondPoints’, em=1) # Get the number of faces, the number of vertices and the number of divisions nbfaces = cmds.polyEvaluate(“surface”, f=True ) nbvertex = cmds.polyEvaluate(“surface”, v=True ) udiv = cmds.getAttr(“surface.udivision”) udiv = int(udiv[0][0]) vdiv = cmds.getAttr(“surface.vdivision”) vdiv = int(vdiv[0][0])

############################################ # STEP01 # Get the Primary points # Create a locator in each point location ############################################

Page 33: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

PrimPoints = [] PrimVtx = [] for i in range(0,nbvertex,1): # Create locator in each vertex position nvtx = “%s.vtx[%i]” %(“surface”, i) pos = cmds.pointPosition(nvtx) nloc = “PrimPoint_%i” %i loc = cmds.spaceLocator(p=pos, n=nloc) cmds.parent(loc, “PrimPoints”) cmds.addAttr(ln=”distanceto%s”%loc[0], dt=”string”, keyable=1, w=1) # Add the name of the corresponding vertex in the locator’s attributes cmds.select(loc[0]) cmds.addAttr(ln=”vertex”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.vertex”, nvtx, type=”string”) # By default is not a border cmds.addAttr(ln=”border”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.border”, ‘False’, type=”string”) # Fill the lists.. # SecondPoints == Name of the vertex with its corresponding locator # inputList = (nvtx, “PrimPoint_%i” %i) PrimPoints.append(“PrimPoint_%i” %i) PrimVtx.append(nvtx) # Set the original edges (except the borders) to delete, # in order to remain only the “connexions” edgestodelete = [] for i in range(0,nbfaces,1): # Get the points nf = “%s.f[%i]” %(“surface”, i) cmds.select(nf) face = cmds.ls(sl=True) points = cmds.polyListComponentConversion(face, ff=1, tv=1) # Delete the useless edge to remain only the “cuts” edges = cmds.polyListComponentConversion(face, ff=1, te=1) edgestodelete.append(edges) # Get the points name cmds.select(points) points = cmds.ls(sl=True, fl=1) ################################################# # STEP02: # Get the secondary points # Sudbivide each face to get the secondary cuts #################################################

cmds.polyPoke(“%s.f[0:%s]” %(“surface”, nbfaces)) newvertex = cmds.polyEvaluate(“surface”, v=True ) # For each new vertex SecondPoints = [] SecondVtx = [] bordervtx = [] # For each new vertex created = Secondary points for i in range(nbvertex,newvertex,1): # Get the name of the new vertices created nvtx = “%s.vtx[%i]” %(“surface”, i) # Create a Locator on the position of the Secondary Points pos = cmds.pointPosition(nvtx) nloc = “SecondPoint_%i” %(i-nbvertex) loc = cmds.spaceLocator(p=pos, n=nloc) cmds.parent(loc, “SecondPoints”) # Add the name of the corresponding vertex in the locator’s attribut cmds.select(loc[0]) cmds.addAttr(ln=”vertex”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.vertex”, nvtx, type=”string”) # By default is not a border cmds.addAttr(ln=”border”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.border”, ‘False’, type=”string”) # Fill the lists.. # SecondPoints == Name of the vertex with its corresponding locator SecondPoints.append(nloc) SecondVtx.append(nvtx) # Save informations in the surface attr. # Add nb of Primary & Secondary Points in the surface attr cmds.select(‘surface’) cmds.addAttr(ln=”nbPrim”, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.nbPrim”, len(PrimPoints), type=”string”)

cmds.addAttr(ln=”nbSecond”, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.nbSecond”, len(SecondPoints), type=”string”)

######################################## # STEP03: # Delete the non-cuts edges! ######################################## # Define the borders of the surface ... # ... From the sides of the surface

Page 34: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

for i in range(0, nbvertex, udiv+1): bordervtx.append(“surface.vtx[%i]” % i) bordervtx.append(“surface.vtx[%i]” % (i+udiv)) # ... From the first row. for i in range(1, udiv, 1): bordervtx.append(“surface.vtx[%i]” % i) # ... From the last row start = ((udiv * vdiv)+vdiv+1) for i in range(start, nbvertex-1, 1): bordervtx.append(“surface.vtx[%i]” % i) # Select Vertices border for i in (bordervtx): index = PrimVtx.index(i) nloc = PrimPoints[index] cmds.select(nloc) #cmds.addAttr(ln=”border”, dt=”string”, keyable=1, w=1) cmds.setAttr(nloc + “.border”, ‘True’, type=”string”) # Transform selection in edges borderedg = cmds.polyListComponentConversion(bordervtx, fv=1, te=1, internal=True) # ... And delete the non-cuts edges! cmds.select(cl=True) for i in (edgestodelete): cmds.select(i, add=True) cmds.select(borderedg, d=True) cmds.delete() # feedback print len(PrimPoints),”Primary Points and”, len(SecondPoints), “Secondary Points Succefully created” # Define a function to calculate the distance between two points, # return the point position and the distance def distance(pt1,pt2): pt1 = cmds.pointPosition(pt1) pt2 = cmds.pointPosition(pt2) dx = pt1[0]-pt2[0] dy = pt1[1]-pt2[1] dz = pt1[2]-pt2[2]

distance = [] distance.append(dx) distance.append(dy) distance.append(dz) # Get the “3D” distance dxy = (dx**2+dy**2)**(.5) ad = (dxy**2+dz**2)**(.5) distance.append(ad) return distance

## Calculate the distances between each control points, and all the others points! def controlepoints(*arg): # Get the names of the selected points and store them in the surface attr. points = cmds.ls(sl=True, fl=1) cmds.select(‘surface’) cmds.addAttr(ln=”nbpoints”, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.nbpoints”, len(points), type=”string”) for i in range(0, len(points),1): cmds.select(‘surface’) cmds.addAttr(ln=”pointtooffset%s” %i, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.pointtooffset%s” %i, points[i], type=”string”) cmds.showHidden(‘surface’) # Define the controle points nbpoints = cmds.getAttr(‘surface.nbpoints’) Pointtooffset = [] for i in range (0, int(nbpoints),1): point = cmds.getAttr(‘surface.pointtooffset%s’ %i) Pointtooffset.append(point) # For each control point for n in (Pointtooffset): alreadycontroled = [] pointstoselect = [] # Number of vertices in total nbvertex = cmds.polyEvaluate(“surface”, v=True ) vertex = cmds.getAttr(n + “.vertex”) verticestoselect = cmds.select(‘surface.vtx[:]’)

Page 35: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

verticestoselect = cmds.select(vertex, d=True) verticestoselect = cmds.ls(sl=True, fl=True) nbPrim = cmds.getAttr(“surface.nbPrim”) nbSecond = cmds.getAttr(“surface.nbSecond”) # Select the locator except the control point! cmds.select(cl=True) for i in range(int(nbPrim)): cmds.select(“PrimPoint_%s”%i, add=True) for i in range(int(nbSecond)): cmds.select(“SecondPoint_%s”%i, add=True) cmds.select(n, d=True) loc = cmds.ls(sl=True, fl=True) # Get the locators and its corresponding vertex. Locators = [] Vertices = [] for i in (loc): #index = Vertices.index(i) #loc = Locators[index] vertex = cmds.getAttr(i + “.vertex”) Locators.append(i) Vertices.append(vertex) # For each vertex, get the distance from the control point for v in (verticestoselect): d = distance(n,v)

index = Vertices.index(v) loc = Locators[index] # And store the result in the locator attributes. cmds.select(loc) cmds.addAttr(ln=”distanceto%s”%n, dt=”string”, keyable=1, w=1) cmds.setAttr(loc + “.distanceto%s”%n, d[3], type=”string”) # Feedback print nbvertex, “distances from”,nbpoints,”points succesfully calculated “ # Define the main function ::: Move the points according to the new positions of # the control points! with a constant distance between them def Quinconce(*arg):

nbpoints = cmds.getAttr(‘surface.nbpoints’) Pointtooffset = [] # Get the control points for i in range (0, int(nbpoints),1): point = cmds.getAttr(‘surface.pointtooffset%s’ %i) Pointtooffset.append(point) # For each control point c for c in (Pointtooffset): # get its vertex name and move them to the new position xoffset = cmds.getAttr(c+”.translateX”) yoffset = cmds.getAttr(c+”.translateY”) zoffset = cmds.getAttr(c+”.translateZ”) controlvertex = cmds.getAttr(c+”.vertex”) cmds.move(xoffset,yoffset,zoffset, controlvertex, r=True) #cmds.move(xoffset,yoffset,zoffset, c, r=True) # polyevaluate the number of vertices and faces nbvertex = cmds.polyEvaluate(“surface”, v=True ) nbfaces = cmds.polyEvaluate(“surface”, f=True ) # Get the number of Primary & Secondary points nbPrim = cmds.getAttr(“surface.nbPrim”) nbSecond = cmds.getAttr(“surface.nbSecond”) # Store the name of these points with their corresponding vertices Locators = [] Vertices = [] for i in range(int(nbPrim)): nloc = “PrimPoint_%s” %i vertex = cmds.getAttr(nloc+”.vertex”) Locators.append(nloc) Vertices.append(vertex) for i in range(int(nbSecond)): nloc = “SecondPoint_%s” %i vertex = cmds.getAttr(nloc+”.vertex”) Locators.append(nloc) Vertices.append(vertex) # Get the points to move == all points except the point to offset # and eventually the borders points cmds.select(“surface.vtx[:]”) cmds.select(controlvertex, d=True) cmds.select(c, d=True) pointstomove = cmds.ls(sl=True, fl=1)

Page 36: Quinconce Final Presentation

CAD LOGIC SS 08/09Slitting / documentation AA’

# For each pointomove for p in (pointstomove): # Get its corresponding locator index = Vertices.index(p) nloc = Locators[index] index = Pointtooffset.index(c) d1 = cmds.getAttr(nloc+”.distanceto%s” %c) # Get the new distance after offset d2 = distance(controlvertex, p) # Get the position of the moved main point & the initial point position pos1 = cmds.pointPosition(controlvertex) pos2 = cmds.pointPosition(p) # Draw a curve between these points! and get the new position of # the point on this curve curve = cmds.curve(p= [pos1, pos2], d=1) if float(d1) >= d2[3]: d = d2[3]/float(d1) else: d = float(d1)/d2[3] # Move the point to this new position cmds.select(curve) newpos = cmds.pointOnCurve( curve, pr=d , top=1, p=1) cmds.move(newpos[0], newpos[1], newpos[2], p, a=True) cmds.move(newpos[0], newpos[1], newpos[2], nloc, a=True) cmds.delete(curve) # Feedback print “Points succesfully moved”

############################# EXECUTE THE SCRIPT #######################################################initparameters()##########################