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

connect inversion #34

Open
sonoro1234 opened this issue Oct 16, 2019 · 0 comments
Open

connect inversion #34

sonoro1234 opened this issue Oct 16, 2019 · 0 comments

Comments

@sonoro1234
Copy link
Contributor

sonoro1234 commented Oct 16, 2019

I am proposing a change in the par_shapes__connect function.
The change is in https://github.com/prideout/par/blob/master/par_shapes.h#L1166
from

    memcpy(newpts, cylinder->points + (slices + 1) * 3,
        sizeof(float) * (slices + 1) * 3);

to memcpy(newpts, cylinder->points ,sizeof(float) * (slices + 1) * 3);

This are the results from lsystem
before
connect_lsystem1

and after
connect_lsystem2

difference is difficult to see.

But with this code:

        local mesh = par_shapes.create.empty()
	local tube = par_shapes.create.cylinder(slices, 1);
	local cone = par_shapes.create.cone(slices,1)
	mesh:merge(tube)
	cone:translate(1,1,3)
	mesh:connect(cone,slices)
	mesh:merge(cone)

we have before: end to end connection
connect_cone1

and after: end to begining connection
connect_cone2

For me, the expected result would be the second.
The proposed change is in PR #35

Perhaps another solution would be having an extra boolean argument to par_shapes__connect for choosing the way of connect (direct or inverse)

What is your opinion?

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