Skip to content

connect inversion #34

@sonoro1234

Description

@sonoro1234

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions