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

Improve function for brick-seams #2

Open
sttng opened this issue Oct 8, 2020 · 2 comments
Open

Improve function for brick-seams #2

sttng opened this issue Oct 8, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sttng
Copy link
Owner

sttng commented Oct 8, 2020

Current function is based on scaling the bricks by a factor in %.

# Random Scale for brick seams
out.write("\t\tScale {0} {0} {0}\n".format(random.uniform(0.9925, 1.000)))

This means that larger bricks are scaled by more absolute milimeters then small bricks (i.e. the absolute value is larger for larger bricks then compared to for smaller bricks, even the scaling percentage is the same).

Investigate if there is a possibilty to have a similar absolute value by using maybe Bounding or GeometryBounding to adjust the scaling factor accordingly.

  <Bounding>
    <AABB minX="-0.939257" minY="-2.40269" minZ="-0.001587" maxX="1.59363" maxY="0.831503" maxZ="1.78367" />
  </Bounding>
  <GeometryBounding>
    <AABB minX="-0.939257" minY="-2.28474" minZ="-0.001587" maxX="1.59363" maxY="0.831503" maxZ="1.78367" />
  </GeometryBounding>
@sttng sttng self-assigned this Oct 8, 2020
@sttng sttng added enhancement New feature or request help wanted Extra attention is needed labels Oct 8, 2020
@sttng
Copy link
Owner Author

sttng commented Oct 8, 2020

Idea:

calcualte

maxlist = [abs(minX - maxX), abs(minY - maxY), abs(minZ - maxZ)] 
maxlist.sort() 
maxBounding = list1[-1] 
scalefact = (maxBounding - 0.1 * random.uniform(0.9925, 1.000)) / maxBounding
# Random Scale for brick seams
out.write("\t\tScale {0} {0} {0}\n".format(scalefact))

In addition one could also randomly (maybe 50% chance) add a rotation around the x-axes by +/- 1-2 degrees:

if random() < .5:

@sttng
Copy link
Owner Author

sttng commented Oct 11, 2020

  • scalefactor calculation based on Bounding implemented ✔️
  • random rotation still pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant