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

Binormals are hard (sweep operations) #68

Open
VikingScientist opened this issue Apr 5, 2018 · 1 comment
Open

Binormals are hard (sweep operations) #68

VikingScientist opened this issue Apr 5, 2018 · 1 comment

Comments

@VikingScientist
Copy link
Member

from splipy import *                                                           
from splipy.io import *                                                        
import splipy.curve_factory as cf                                              
import splipy.surface_factory as sf                                            
import splipy.volume_factory as vf                                             
from math import pi                                                            
                                                                               
c1 = cf.line([1,0,0], [5-2.3, 0, 0])                                           
c2 = cf.circle_segment(pi/2, 1.3, center=(5-2.3, 0, 1.3), normal=(0,-1,0))        
c3 = cf.line([5-1, 0, 1.3], [5-1, 0, 10])                                     
c1.append(c2).append(c3)                                                       
                                                                               
vol = vf.sweep(c1, sf.disc(1, type='square'))                                  
vol.refine(2) # just for better plotting resolution                                                                  
                                                                               
with G2("out.g2") as f:                                                        
    f.write(vol)                                                               

The setup is to create a curve piece of a two linear pieces connected by a 90 degree circle segment. Along this curve piece we drag a flat surface disc to sweep out a tube-like volumetric geometry.

binormals

The reason for the bug is that the binormals require acceleration terms to compute, but for linear curve pieces these are [0,0,0]. I tried to create some form of heuristic where it's defined to be along the x/y/z-axis and in addition not parallel to the velocity vector. However it now seems like this heuristic fails at the transition between linear curve pieces and circular curve pieces.

@VikingScientist
Copy link
Member Author

It's hard to define this as a bug since the binormal is mathematically ill-defined along straight lines. However, the reasonable choice given that we can choose any binormal we want (except parallel to the velocity), would be to choose the one which is at the end of the circular piece. From an implementation point of view, this means we have to search along the curve piece for the nearest well-defined binormal which in this case is in the center of the curve. What happens if you have a well-defined binormal both before and after the linear piece; i.e. a U-form of shape with linear-curved-linear-curved-linear structure? Do we do some sort of interpolation between the two nearest binormals?

Tagging this as enhancement since the current implementation isn't exactly wrong, its just impractical.

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

No branches or pull requests

1 participant