Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build swept surface along a closed spline #74

Open
marcocecchiscmgroup opened this issue Jun 7, 2023 · 3 comments
Open

Failure to build swept surface along a closed spline #74

marcocecchiscmgroup opened this issue Jun 7, 2023 · 3 comments

Comments

@marcocecchiscmgroup
Copy link

marcocecchiscmgroup commented Jun 7, 2023

The enclosed model tube.f3d was created with Fusion 360, simply by using the 'tube' command, which is nothing but a swept of a circle along a given curve. The curve was a closed spline.
When converting, an exception 'Geom_BSplineCurve: Weights values too small' is raised. Problem is that the weights are all 1.0, so they are ok, in number as well. The real deal is that, in the SAT representation, the spline curve is given as open. In fact, with this change in Acis.py/createBSplinesCurve(nubs, sense) the model is imported correctly:

			if (nubs.rational):
				bsc.buildFromPolesMultsKnots(		\
					poles		  = nubs.poles,		\
					mults		  = nubs.uMults,	\
					knots		  = nubs.uKnots,	\
					periodic	  = True, # False, nubs.uPeriodic,	\
					degree		  = nubs.uDegree,	\

The original value is False. On top of my head, I'd say it should have been nubs.uPeriodic, but there must surely be a good reason for that. If that reason is that you noticed that the 'open'/'periodic' tags in the acis format are not realiable, well, then I think this is yet another example. Of course the actual periodicity cannot be known before building the spline, but from the cardinality of the parameters it should probably be feasibile, i.e. n+1 control points and n+p+2 knots as described here below?
Closed B-spline

There is another problem, however, which worries me more. When I dump the sat representation of the f3d model and try to convert it directly, a step file missing any kind of geometries is produced. Does reading from sat trigger a different round of ready_to_build, None checks and the like?

tube.zip

@marcocecchiscmgroup
Copy link
Author

marcocecchiscmgroup commented Jun 7, 2023

My bad, I was mislead by the hard-coded False and by the fact that I knew the spline was closed: changing to True is not the real reason for the model being imported correctly, it just triggers a caught exception so that createBSplinesCurve(nubs, sense) returns None and the conversion can continue!
Instead, False doesn't immediately trigger an exception, it does it in another place which must prevent resuming, at this point.

The question about the value True / False / nubs.uPeriodic, remains, however.

@marcocecchiscmgroup
Copy link
Author

marcocecchiscmgroup commented Jun 7, 2023

I am afraid this is not the most effective 'fix' to do:

			elif (self.subtype == 'sweep_spl_sur'):
				profile = self.profile.build(None, None)
				if (profile):
					path = self.path.build(None, None)
					if (path):
						try:
							self.shape = Part.makeSweepSurface(path, profile)
						except:
							pass

waiting for feedback.

@marcocecchiscmgroup
Copy link
Author

Dear Jens,

it's a pity that you are not working on this project anymore.

What are you plans?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant