Skip to content

An error occurred while customizing the node location #327

Closed Answered by Ali-7800
cuicw asked this question in Q&A
Discussion options

You must be logged in to vote

@cuicw You need to specify the the directors for the rods, this is a way of finding them:

import numpy as np
from elastica._linalg import (
    _batch_norm,
)

director_collection = np.zeros((3, 3, n_elem))
normal_collection = np.zeros((3, n_elem))
binormal_collection = np.zeros((3, n_elem))

# Compute rod tangents using positions
position_for_difference = position_collection
position_diff = position_for_difference[..., 1:] - position_for_difference[..., :-1]
rest_lengths = _batch_norm(position_diff)
tangents = position_diff / rest_lengths

for i in range(n_elem):
    # Compute the normal vector at each element. Since we allow helix radius to vary, we need to compute
    # vectors creatin…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@cuicw
Comment options

@cuicw
Comment options

Answer selected by Ali-7800
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants