ScriptSpot

Forum topic · Scripts Wanted

XY extrude

By harumscarum · 2012-06-22

Description

would be great to have tool to extrude spline in XY axis, modifier possibly...

Comments (4)

The Right Question :

obaida · 2012-11-24

How to change the (normal) of line so the direction of extrude modifier will change also .
OR :
(making the extrude modifier have an option like local X,Y,Z direction)
in this way there is no need to attatch the line to another one with correct normal direction .

extrudeXY

barigazy · 2012-06-26

This fn do the right job.
Options:
*theShape - spline that you need extrusion
*offset - extrude/offset value
*type - choose three type of extrusion:#center, #in or #out pivot alignement
*banking along the spline (on or off)

fn extrudeSplineXY theShape offset: type: bank: = if isKindOf theShape Shape do
(
local ext = offset as float
profile = SplineShape pos:(point3 0 0 0)
addNewSpline profile
addKnot profile 1 #corner #line (point3 (ext/2) 0 0)
addKnot profile 1 #corner #line (point3 (-ext/2) 0 0)
updateShape profile
local sweepMod = sweep CustomShape:1 GenerateMappingCoords:on Banking:bank
case type of (
(#center): sweepMod.PivotAlignment = 4
(#in): sweepMod.PivotAlignment = 7
(#out): sweepMod.PivotAlignment = 1
)
sweepMod.shapes[1] = profile
addModifier theShape sweepMod
delete profile
)
extrudeSplineXY $ offset:10 type:#in bank:on

kimarotta · 2012-06-26

This is a way for you to develop your tool...

	
fn extrudeLine ey ez =
(
 
sel = $
applyOffset $ ey
select sel
modPanel.addModToSelection (Extrude ()) ui:on
$.modifiers[#Extrude].amount = ez
 
)

 
extrudeLine 5 10

Good Luck

obaida · 2012-06-26

sweep modifier can do this job .