question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cylinders not randomly distributed in x-y plane from generators.cylinders

See original GitHub issue

Due to some property of how random fiber locations are selected, fibers are more likely to cross near the center of the x-y plane versus point closer to the edge. This code makes a structure, then calculates the porosity at each x-y location.

import porespy as ps
import matplotlib.pyplot as plt
import numpy as np

im = ps.generators.cylinders([400,400,1000],5, 7000,0,90,None)
mean = np.mean(im,2)
plt.imshow(mean,cmap='plasma')
plt.show()
print(ps.metrics.porosity(im))

Results: image

A more dramatic example for a 1000x1000x1000 fiber image with a porosity of 0.5.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jgostickcommented, May 22, 2020

I am going to merge this change into dev since you’re ok with it. I will close this issue now.

2reactions
jgostickcommented, May 21, 2020

@1minus1 I implemented something close to your quick fix in PR #245. The starting points are generated over a much larger region now. I basically increase the region by the requested cylinder length on all sides. Anything more than that would be pointless since the the generated cylinder would not reach that actual domain. I did this without actually creating a larger image, which is good. The down side, as you say is that more tries are required to get the correct number of cylinders. The function was still decently fast on my laptop though, but I didn’t compare times. Let me know if this new version works better for you. We can still discuss the porosity thing separately, but at least you’ll have a valid function to build on!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Directrix - an overview | ScienceDirect Topics
As the generatrix moves along the directrix so that it stays always parallel to a given direction, it generates the surface of a...
Read more >
Interference fit in cylinders - Ansys Learning Forum
i am trying to create an interference fit betwwen two cylinders on Ansys and as soon as extrude the seconde cylinder they get...
Read more >
Finite element study of displacement controlled fretting in ...
Two mechanical models relative to the X-Y plane are consistent. The interface between the two cylinders is described by the Coulomb friction ...
Read more >
Scattering by closely spaced parallel nonhomogeneous ...
The angle ϕ1 is commonly called the angle of incidence on the cylinder, as it is inclined from the XY plane that is...
Read more >
6.3 Applying Gauss's Law - University Physics Volume 2
A charge distribution has cylindrical symmetry if the charge density depends only upon the distance r from the axis of a cylinder and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found