Surface sweep function too restricted

Surface sweep function too restricted

adminTCYL2
Enthusiast Enthusiast
587 Views
6 Replies
Message 1 of 7

Surface sweep function too restricted

adminTCYL2
Enthusiast
Enthusiast

For an electrical project I try to show a spool that runs along a torus-spool. 

To draw such spools I use a surface sweep along a circled path. If the path is a circle it works fine even with 100 rotations: 

adminTCYL2_4-1629278310872.png

Then I do a solid sweep along the edges of this sweep to geht the spool:

adminTCYL2_5-1629278327175.png

But if the path itself is a torus (very similar to a circle) I can not do 100 rotations, only 12. Why?

The next 2 images show that 12 rotations work...

adminTCYL2_6-1629278390535.png

and more don't:

adminTCYL2_7-1629278466570.png

But with 12 rotations I do not get a good electrical spool. It seems unpossible to draw 100 rotations because of restrictions in sweep feature in case of 3 dimensional curves. But why do these restrictions exist?

 

adminTCYL2_9-1629278634744.png

I attache the sketches:

 

 

 

0 Likes
588 Views
6 Replies
Replies (6)
Message 2 of 7

HughesTooling
Consultant
Consultant

Part of the problem is the first spline is not as good a quality you get using the edge of a surface. If I recreate using the edge of a surface I can get 60 turns. Tip never use project include 3d geometry for something like this, the edge of a surface has more accuracy.

HughesTooling_0-1629282222649.png

 

Next problem is solid sweep and pipe both fail to create a good body so I had to use a surface sweep, cap and the stitch to get a good body. File's attached.

HughesTooling_1-1629282491460.png

 

Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 3 of 7

HughesTooling
Consultant
Consultant

@jeff_strater any idea why you can not create more than 60 turns on the sweep, too much data?

 

Also why Pipe and Sweep fail to create good body. File's attached with the Pipe body.

HughesTooling_0-1629282795113.png

 

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 4 of 7

jeff_strater
Community Manager
Community Manager

@HughesTooling - I'm not sure.  Maybe a bit of built-in self protection?  (just kidding)  I do recall issues like this in the past, where sweep stops on a path like this.  I'm on vacation now, but I can check when I get back in the office.


Jeff Strater
Engineering Director
Message 5 of 7

adminTCYL2
Enthusiast
Enthusiast

We did a script that automatise the creation of coils. It dissapoints me, that on splines it does not work so well: 
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/sweep-along-a-path-out-of-lines-and-arcs-b...
You see in my example up there, that 13 coil-windings are far from overlapping, but the sweep gives a failure. There don't seem to be a mathematical reason for this failure. 


0 Likes
Message 6 of 7

adminTCYL2
Enthusiast
Enthusiast

HughesTooling, unfortunately your approach with the 60 windings does not help me, because it is no exact Torus that I have to be spooled. But thank you for your example. It gives a hint where the problem lies. What is so different between edges of solids and spine-curves? Why do spline curves not the same job?

0 Likes
Message 7 of 7

adminTCYL2
Enthusiast
Enthusiast

I am near a solution now. I found out how to combine arcs along a set of points, so that I get a spline-like curve.  As I showed arcs are the perfect basis for rotated sweeps. The following script sweeps a rotated surface along acs that form a torus-winding. 
There is only one problem: I draw a new profil for each arc-sector. But what I want to do is: use the edge of the last rotated sector as profile for the next, to get a continous surface. My sweeps right now are not connected. 
adminTCYL2_0-1631541248449.png

The problem is: The API does not accept edges as profiles. If I do it in Fusion360 by hand, it is possible.

So how can an edge be used as an non solid profile for a sweep in the API?

(You see a out-commanded part in my script. It shows what I tried. )
Is there someone who knows a solution? 

 

 

 

 

import adsk.core, adsk.fusion, adsk.cam, traceback, math

def run(context):
	ui = None
	try:
		app = adsk.core.Application.get()
		ui = app.userInterface
		design = app.activeProduct
		# Get the root component of the active design.
		root_comp = design.rootComponent
		# Create a new sketch on the xy plane.
		sketches = root_comp.sketches
		xyPlane = root_comp.xYConstructionPlane
		sketch = sketches.add(xyPlane)
		points = adsk.core.ObjectCollection.create() # Create an object collection for the points.
        

		windings = 10
		pointsPerRound = 4 # Number of points that splines are generated.
		i = -pointsPerRound*windings #Startwert, der in der Schleife runtergezählt wird
		r = 0.5
		h = 0


		while i <= 0:
			t = (math.pi/(pointsPerRound*windings))*i*2
			h = 1.5+((-r)*(math.sin(t*windings)))
			xCoord = (h)*(math.sin(t))
			yCoord = (h)*(math.cos(t))
			zCoord = ((-r)*(math.cos(t*windings)))
			points.add(adsk.core.Point3D.create(xCoord,yCoord,zCoord))
			i = i + 1
		
		#Combining the points to arcs
		arcs = adsk.core.ObjectCollection.create()
		for j in range(0,int((windings*pointsPerRound)/2)):
			arc = sketch.sketchCurves.sketchArcs.addByThreePoints(points[2*j],points[2*j+1],points[2*j+2])
			arcs.add(arc)
			profilStart = adsk.core.Point3D.create(points[2*j].x,points[2*j].y,points[2*j].z-0.2)
			profilEnd =   adsk.core.Point3D.create(points[2*j].x,points[2*j].y,points[2*j].z-0.01)
			profil=sketch.sketchCurves.sketchLines.addByTwoPoints(profilStart,profilEnd)

			"""
			# The right way would be: define a start profile for the sweep...
			if j==0:
				profilStart = adsk.core.Point3D.create(points[0].x,points[0].y,points[0].z-0.2)
				profilEnd =   adsk.core.Point3D.create(points[0].x,points[0].y,points[0].z-0.01)		
				profil=sketch.sketchCurves.sketchLines.addByTwoPoints(profilStart,profilEnd)
			# ..and then use the edge of the last sweep as profile for the next: 
			else:
				itemIndex = root_comp.bRepBodies.count-1
				body = root_comp.bRepBodies.item(itemIndex)
				profil=	body.edges.item(3)  #it is not clear witch of the four items
				sketch.add(profil)
			"""
			prof = root_comp.createOpenProfile(profil, False)
			path = root_comp.features.createPath(arc, False)
			sweeps = root_comp.features.sweepFeatures
			sweepInput1 = sweeps.createInput(prof, path, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
			sweepInput1.twistAngle = adsk.core.ValueInput.createByReal(100)
			sweepInput1.isSolid = False
			sweep = sweeps.add(sweepInput1)

		for j in range(0,10):
			arcs[j].startSketchPoint.merge(arcs[j+1].endSketchPoint)


	except:
		if ui:
			ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

 

 

 

 

 



0 Likes